├── .flowconfig ├── .gitignore ├── .travis.yml ├── CHANGES ├── MIT.LICENSE ├── README.md ├── VERSION ├── docs ├── assets │ ├── anm.gif │ ├── core.gif │ ├── example-anm-compact.png │ ├── example-anm-plain.png │ ├── example-anm.png │ ├── example-network.png │ ├── example-pd.png │ ├── example-processing-compact-v.png │ ├── example-processing-compact.png │ ├── example-processing-plain.png │ ├── example-processing.png │ ├── example-timbre.png │ ├── example-util-ableton-out.png │ ├── example-util-ableton.png │ ├── example-util-black-white.png │ ├── example-util-blender.png │ ├── example-util-compact-v.png │ ├── example-util-svg.png │ ├── example-util.png │ ├── in_progress.png │ ├── in_progress.svg │ ├── in_progress@2x.png │ ├── in_progress@2x.svg │ ├── inlets.png │ ├── inlets.svg │ ├── inlets@2x.png │ ├── inlets@2x.svg │ ├── instance-renderer.png │ ├── instance-renderer.svg │ ├── instance-renderer@2x.png │ ├── instance-renderer@2x.svg │ ├── link-no-frame.png │ ├── link-no-frame.svg │ ├── link-no-frame@2x.png │ ├── link-no-frame@2x.svg │ ├── link.png │ ├── link.svg │ ├── link@2x.png │ ├── link@2x.svg │ ├── logo-small.png │ ├── logo.png │ ├── node-no-frame.png │ ├── node-no-frame.svg │ ├── node-no-frame@2x.png │ ├── node-no-frame@2x.svg │ ├── node.png │ ├── node.svg │ ├── node@2x.png │ ├── node@2x.svg │ ├── outlets.png │ ├── outlets.svg │ ├── outlets@2x.png │ ├── outlets@2x.svg │ ├── patch-no-frame.png │ ├── patch-no-frame.svg │ ├── patch-no-frame@2x.png │ ├── patch-no-frame@2x.svg │ ├── patch.png │ ├── patch.svg │ ├── patch@2x.png │ ├── patch@2x.svg │ ├── pd.gif │ ├── projection-no-frame.png │ ├── projection-no-frame.svg │ ├── projection-no-frame@2x.png │ ├── projection-no-frame@2x.svg │ ├── projection.png │ ├── projection.svg │ ├── projection@2x.png │ ├── projection@2x.svg │ ├── render-flow.png │ ├── render-flow.svg │ ├── render-flow@2x.png │ ├── render-flow@2x.svg │ ├── renderer.png │ ├── renderer.svg │ ├── renderer@2x.png │ ├── renderer@2x.svg │ ├── rpd-connect.gif │ ├── rpd-disconnect.gif │ ├── rpd-network.png │ ├── rpd-network.svg │ ├── rpd-network@2x.png │ ├── rpd-network@2x.svg │ ├── rpd-node.png │ ├── rpd-node.svg │ ├── rpd-node@2x.png │ ├── rpd-node@2x.svg │ ├── rpd-reconnect.gif │ ├── rpd-vimeo.png │ ├── rpd_bodyedit_pd.gif │ ├── rpd_bodyedit_quartz.gif │ ├── rpd_connecting_in_progress.gif │ ├── rpd_sum_node.gif │ ├── sandbox.png │ ├── style.png │ ├── style.svg │ ├── style@2x.png │ ├── style@2x.svg │ ├── target.png │ ├── target.svg │ ├── target@2x.png │ ├── target@2x.svg │ └── video-timbre.png ├── config.json ├── examples.md ├── index-patches.js ├── index.md ├── layout.jade ├── rpd.svg ├── sections │ ├── api.md │ ├── events.md │ ├── network.md │ ├── participate.md │ ├── setup.md │ ├── style.md │ └── toolkits.md └── style.css ├── examples ├── anm-compact.html ├── anm-plain.html ├── anm.html ├── docs-patch.html ├── docs-patch.js ├── example.pd ├── example.sketch.js ├── index-page.html ├── network.html ├── pd-file.html ├── pd.html ├── processing-compact-v.html ├── processing-compact.html ├── processing-plain.html ├── processing-toolkit-svg.js ├── processing.html ├── rpd.svg ├── sandbox.html ├── timbre.html ├── two-patches.html ├── util-ableton-out.html ├── util-ableton.html ├── util-black-white.html ├── util-blender.html ├── util-compact-v.html ├── util-demo.js ├── util-svg.html ├── util.html └── visual-history.html ├── gulpfile.js ├── package.json ├── rpd.js.flow ├── spec ├── Runner.html ├── building │ ├── inlet.spec.js │ ├── link.spec.js │ ├── network.spec.js │ ├── node.spec.js │ ├── outlet.spec.js │ ├── patch.spec.js │ └── render.spec.js ├── flow │ ├── data.flow.js │ ├── events.flow.js │ ├── network.flow.js │ ├── registration.flow.js │ └── render.flow.js ├── io.spec.js ├── karma.conf.js ├── matchers.js ├── navigation.spec.js ├── prepare.js ├── prettify.js └── registration │ ├── channelrenderer.spec.js │ ├── channeltype.spec.js │ ├── general.spec.js │ ├── noderenderer.spec.js │ ├── nodetype.spec.js │ └── renderer.spec.js └── src ├── io ├── json.js ├── pd.js └── plain.js ├── modules ├── visual-history.css └── visual-history.js ├── navigation └── browser.js ├── render ├── css.schema ├── html.css ├── html.js ├── shared.js ├── svg.css └── svg.js ├── rpd.js ├── style ├── ableton-out │ ├── svg.css │ └── svg.js ├── ableton │ ├── svg.css │ └── svg.js ├── black-white │ ├── svg.css │ └── svg.js ├── blender │ ├── svg.css │ └── svg.js ├── compact-v │ ├── svg.css │ └── svg.js ├── compact │ ├── html.css │ ├── html.js │ ├── svg.css │ └── svg.js ├── pd │ ├── html.css │ ├── html.js │ ├── svg.css │ └── svg.js ├── plain │ ├── html.css │ ├── html.js │ ├── svg.css │ └── svg.js ├── quartz │ ├── html.css │ ├── html.js │ ├── svg.css │ └── svg.js └── webpd │ ├── svg.css │ └── svg.js └── toolkit ├── anm ├── html.css ├── html.js ├── shared.js └── toolkit.js ├── timbre ├── html.css ├── html.js ├── model.js └── toolkit.js ├── util ├── html.css ├── html.js ├── shared.js ├── svg.css ├── svg.js ├── toolkit.js └── toolkit.md └── webpd ├── shared.js ├── svg.css ├── svg.js └── toolkit.js /.flowconfig: -------------------------------------------------------------------------------- 1 | [version] 2 | ^0.38.0 3 | 4 | [ignore] 5 | .*/node_modules/.*/test/.* 6 | .*/node_modules/.*/tests/.* 7 | 8 | [include] 9 | 10 | [libs] 11 | 12 | [options] 13 | suppress_comment=\\(.\\|\n\\)*\\$ExpectError 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | .idea/ 3 | node_modules/ 4 | dist/ 5 | examples/.pd 6 | spec/lib 7 | spec/Runner.html 8 | compiler.jar 9 | docs/compiled 10 | flow-typed/ 11 | babel-build/ 12 | .babelrc 13 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "7.5.0" 4 | script: npm test 5 | before_script: 6 | - npm install --no-optional 7 | - npm install -g gulp 8 | - npm install -g flow-bin 9 | - flow version 10 | 11 | # Google Chrome 12 | # 13 | # https://github.com/travis-ci/travis-ci/issues/272#issuecomment-14402117 14 | # https://stackoverflow.com/questions/19255976/how-to-make-travis-execute-angular-tests-on-chrome-please-set-env-variable-chr 15 | # 16 | before_install: 17 | - export CHROME_BIN=chromium-browser 18 | - export DISPLAY=:99.0 19 | - sh -e /etc/init.d/xvfb start 20 | -------------------------------------------------------------------------------- /CHANGES: -------------------------------------------------------------------------------- 1 | v3.0.0-alpha.2 2 | 3 | * No more `d3_tiny` and so no more `Rpd.d3` :) (breaking) 4 | 5 | v3.0.0-alpha.1 6 | 7 | * Remove `/vendor` dependencies and move to `/node_modules` (breaking) 8 | * Add `Rpd.d3` as a unique way to access `d3` or `d3_tiny` (breaking) 9 | * `d3.ns` was changed to `d3.namespaces` in d3.js 4.0, so `d3_tiny.ns` should be too (breaking) 10 | 11 | v2.1.3 12 | 13 | Summaries the versions v2.1.0, v2.1.1, v2.1.2 and v2.1.3. 14 | 15 | The corresponding milestone is [v2.1.x](https://github.com/shamansir/rpd/milestone/9?closed=1) 16 | 17 | * Now we're at NPM: https://www.npmjs.com/package/rpd/ 18 | * Flow type definitions: (PR https://github.com/shamansir/rpd/pull/409) 19 | * Ability to configure node body (PR https://github.com/shamansir/rpd/pull/415) 20 | * New styles, Ableton and Ableton-out (PR https://github.com/shamansir/rpd/pull/397) 21 | * Visual History (PR https://github.com/shamansir/rpd/pull/397) 22 | * `util/dial` node 23 | * Ability to `require('rpd')` 24 | * Different fixes 25 | 26 | v2.0.1 27 | 28 | All the changes `v2.0.0` has: 29 | - Better UI; 30 | - Massive API changes and improvements in the sake of consistency; 31 | - Ability to connect patches ("models", maiden name) and navigate between them; 32 | - Simplified renderers; 33 | - SVG Renderer; 34 | - Import/Export; 35 | - Quartz & PD "modes" are now separate "styles" (which reduces resulting file size); 36 | - Improved building, with Gulp; 37 | - [And much more...](https://github.com/shamansir/rpd/milestone/1?closed=1) 38 | 39 | `v2.0.1` [adds](https://github.com/shamansir/rpd/compare/v2.0...v2.0.1): 40 | - Minor styling and rendering fixes 41 | - Update to Kefir v3.3.0 42 | - Update to d3 v4.0 43 | 44 | **NB:** No binaries, since user is intended to compile personal RPD version with preferred options. 45 | 46 | v2.0 47 | 48 | * Tons of changes, will be listed later 49 | 50 | v0.1.5 51 | 52 | * Added tests, running with Jasmine and Karma 53 | * Updated to Kefir 2.6 54 | * Moved example toolkits to separate repositories 55 | * Fixed non-compliant structures in HTML Renderer 56 | * Improved `node/process` event 57 | * Added `render` objects to corresponding events so they use them instead of 58 | asking node/channel instances for this object 59 | * Node updates are fired only after `node/ready` event 60 | 61 | v0.1.0 62 | 63 | 64 | -------------------------------------------------------------------------------- /MIT.LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2015-2016 Anton Kotenko 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 3.0.0-alpha 2 | -------------------------------------------------------------------------------- /docs/assets/anm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/anm.gif -------------------------------------------------------------------------------- /docs/assets/core.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/core.gif -------------------------------------------------------------------------------- /docs/assets/example-anm-compact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-anm-compact.png -------------------------------------------------------------------------------- /docs/assets/example-anm-plain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-anm-plain.png -------------------------------------------------------------------------------- /docs/assets/example-anm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-anm.png -------------------------------------------------------------------------------- /docs/assets/example-network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-network.png -------------------------------------------------------------------------------- /docs/assets/example-pd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-pd.png -------------------------------------------------------------------------------- /docs/assets/example-processing-compact-v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-processing-compact-v.png -------------------------------------------------------------------------------- /docs/assets/example-processing-compact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-processing-compact.png -------------------------------------------------------------------------------- /docs/assets/example-processing-plain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-processing-plain.png -------------------------------------------------------------------------------- /docs/assets/example-processing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-processing.png -------------------------------------------------------------------------------- /docs/assets/example-timbre.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-timbre.png -------------------------------------------------------------------------------- /docs/assets/example-util-ableton-out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-util-ableton-out.png -------------------------------------------------------------------------------- /docs/assets/example-util-ableton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-util-ableton.png -------------------------------------------------------------------------------- /docs/assets/example-util-black-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-util-black-white.png -------------------------------------------------------------------------------- /docs/assets/example-util-blender.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-util-blender.png -------------------------------------------------------------------------------- /docs/assets/example-util-compact-v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-util-compact-v.png -------------------------------------------------------------------------------- /docs/assets/example-util-svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-util-svg.png -------------------------------------------------------------------------------- /docs/assets/example-util.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/example-util.png -------------------------------------------------------------------------------- /docs/assets/in_progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/in_progress.png -------------------------------------------------------------------------------- /docs/assets/in_progress.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | in_progress 4 | Created with Sketch (https://www.bohemiancoding.com/sketch) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/assets/in_progress@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/in_progress@2x.png -------------------------------------------------------------------------------- /docs/assets/in_progress@2x.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | in_progress@2x 4 | Created with Sketch (https://www.bohemiancoding.com/sketch) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/assets/inlets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/inlets.png -------------------------------------------------------------------------------- /docs/assets/inlets@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/inlets@2x.png -------------------------------------------------------------------------------- /docs/assets/instance-renderer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/instance-renderer.png -------------------------------------------------------------------------------- /docs/assets/instance-renderer@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/instance-renderer@2x.png -------------------------------------------------------------------------------- /docs/assets/link-no-frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/link-no-frame.png -------------------------------------------------------------------------------- /docs/assets/link-no-frame.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | link-no-frame 4 | Created with Sketch (https://www.bohemiancoding.com/sketch) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/assets/link-no-frame@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/link-no-frame@2x.png -------------------------------------------------------------------------------- /docs/assets/link-no-frame@2x.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | link-no-frame@2x 4 | Created with Sketch (https://www.bohemiancoding.com/sketch) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/assets/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/link.png -------------------------------------------------------------------------------- /docs/assets/link@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/link@2x.png -------------------------------------------------------------------------------- /docs/assets/logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/logo-small.png -------------------------------------------------------------------------------- /docs/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/logo.png -------------------------------------------------------------------------------- /docs/assets/node-no-frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/node-no-frame.png -------------------------------------------------------------------------------- /docs/assets/node-no-frame@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/node-no-frame@2x.png -------------------------------------------------------------------------------- /docs/assets/node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/node.png -------------------------------------------------------------------------------- /docs/assets/node@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/node@2x.png -------------------------------------------------------------------------------- /docs/assets/outlets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/outlets.png -------------------------------------------------------------------------------- /docs/assets/outlets@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/outlets@2x.png -------------------------------------------------------------------------------- /docs/assets/patch-no-frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/patch-no-frame.png -------------------------------------------------------------------------------- /docs/assets/patch-no-frame@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/patch-no-frame@2x.png -------------------------------------------------------------------------------- /docs/assets/patch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/patch.png -------------------------------------------------------------------------------- /docs/assets/patch@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/patch@2x.png -------------------------------------------------------------------------------- /docs/assets/pd.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/pd.gif -------------------------------------------------------------------------------- /docs/assets/projection-no-frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/projection-no-frame.png -------------------------------------------------------------------------------- /docs/assets/projection-no-frame@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/projection-no-frame@2x.png -------------------------------------------------------------------------------- /docs/assets/projection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/projection.png -------------------------------------------------------------------------------- /docs/assets/projection@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/projection@2x.png -------------------------------------------------------------------------------- /docs/assets/render-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/render-flow.png -------------------------------------------------------------------------------- /docs/assets/render-flow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/render-flow@2x.png -------------------------------------------------------------------------------- /docs/assets/renderer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/renderer.png -------------------------------------------------------------------------------- /docs/assets/renderer@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/renderer@2x.png -------------------------------------------------------------------------------- /docs/assets/rpd-connect.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/rpd-connect.gif -------------------------------------------------------------------------------- /docs/assets/rpd-disconnect.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/rpd-disconnect.gif -------------------------------------------------------------------------------- /docs/assets/rpd-network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/rpd-network.png -------------------------------------------------------------------------------- /docs/assets/rpd-network@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/rpd-network@2x.png -------------------------------------------------------------------------------- /docs/assets/rpd-node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/rpd-node.png -------------------------------------------------------------------------------- /docs/assets/rpd-node@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/rpd-node@2x.png -------------------------------------------------------------------------------- /docs/assets/rpd-reconnect.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/rpd-reconnect.gif -------------------------------------------------------------------------------- /docs/assets/rpd-vimeo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/rpd-vimeo.png -------------------------------------------------------------------------------- /docs/assets/rpd_bodyedit_pd.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/rpd_bodyedit_pd.gif -------------------------------------------------------------------------------- /docs/assets/rpd_bodyedit_quartz.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/rpd_bodyedit_quartz.gif -------------------------------------------------------------------------------- /docs/assets/rpd_connecting_in_progress.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/rpd_connecting_in_progress.gif -------------------------------------------------------------------------------- /docs/assets/rpd_sum_node.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/rpd_sum_node.gif -------------------------------------------------------------------------------- /docs/assets/sandbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/sandbox.png -------------------------------------------------------------------------------- /docs/assets/style.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/style.png -------------------------------------------------------------------------------- /docs/assets/style@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/style@2x.png -------------------------------------------------------------------------------- /docs/assets/target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/target.png -------------------------------------------------------------------------------- /docs/assets/target@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/target@2x.png -------------------------------------------------------------------------------- /docs/assets/video-timbre.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/docs/assets/video-timbre.png -------------------------------------------------------------------------------- /docs/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "v3.x", 3 | "contents": { 4 | "introduction": { 5 | "title": "Introduction", 6 | "path": "index.html", 7 | "subsections": { 8 | "what-is-rpd": "What is RPD?", 9 | "features": "Features", 10 | "code-examples": "Code Examples", 11 | "terminology": "Terminology" 12 | } 13 | }, 14 | "examples": { 15 | "title": "Examples of RPD in Action", 16 | "path": "examples.html", 17 | "subsections": { } 18 | }, 19 | "compilation": { 20 | "title": "Getting Your Version of RPD", 21 | "path": "sections/setup.html", 22 | "subsections": { 23 | "download": "Download", 24 | "setup": "Setup", 25 | "compilation": "Compilation" 26 | } 27 | }, 28 | "network": { 29 | "title": "Building a Patch Network", 30 | "path": "sections/network.html", 31 | "subsections": { 32 | "setup-rendering": "Setup Rendering", 33 | "creating-a-patch": "Creating a Patch", 34 | "adding-nodes": "Adding Nodes", 35 | "connecting-nodes": "Connecting Nodes", 36 | "sending-data": "Sending Data", 37 | "adding-sub-patches": "Adding Subpatches", 38 | "adding-import-export": "Adding Import/Export" 39 | } 40 | }, 41 | "api": { 42 | "title": "API", 43 | "path": "sections/api.html", 44 | "subsections": { 45 | "rpd": "Rpd", 46 | "patch": "Patch", 47 | "node": "Node", 48 | "inlet": "Inlet", 49 | "outlet": "Outlet", 50 | "link": "Link", 51 | "modules": "Modules" 52 | } 53 | }, 54 | "toolkits": { 55 | "title": "Creating Your Own Toolkits", 56 | "path": "sections/toolkits.html", 57 | "subsections": { 58 | "creating-toolkits": "Organizational Moments", 59 | "defining-channel-type": "Defining Channel Type", 60 | "defining-node-type": "Defining Node Type", 61 | "writing-channel-renderer": "Writing Channel Renderer", 62 | "writing-node-renderer": "Writing Node Renderer", 63 | "writing-custom-i-o-module": "Writing Custom I/O Module" 64 | } 65 | }, 66 | "styling": { 67 | "title": "Custom Styling RPD", 68 | "path": "sections/style.html", 69 | "subsections": { 70 | "using-css-classes": "Using CSS Classes", 71 | "writing-your-own-renderer": "Writing Your Own Renderer", 72 | "writing-your-own-style": "Writing Your Own Style" 73 | } 74 | }, 75 | "events": { 76 | "title": "Subscribing to Events", 77 | "path": "sections/events.html", 78 | "subsections": { 79 | "global-events": "Global Events", 80 | "network-events": "Network Events", 81 | "patch-events": "Patch Events", 82 | "node-events": "Node Events", 83 | "outlet-events": "Outlet Events", 84 | "inlet-events": "Inlet Events", 85 | "link-events": "Link events" 86 | } 87 | }, 88 | "participation": { 89 | "title": "Participating in Development", 90 | "path": "sections/participate.html" 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /docs/examples.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Examples of RPD in Action 3 | id: examples 4 | --- 5 | 6 | NB: Versions of RPD used in these examples may appear not to be up-to-date, please use the methods described on [Setup page](./sections/setup.html) to ensure you get the latest one. 7 | 8 | * Animatron toolkit, compact style, HTML [![Animatron toolkit, Compact style, HTML](./assets/example-anm-compact.png)](./examples/anm-compact.html) 9 | * Animatron toolkit, plain style, HTML [![Plain style, Animatron toolkit, HTML](./assets/example-anm-plain.png)](./examples/anm-plain.html) 10 | * Animatron toolkit, pd style, HTML [![PD style, Animatron toolkit, HTML](./assets/example-anm.png)](./examples/anm.html) 11 | * Pure Data toolkit, webpd style, SVG [![WebPD Style, Pure Data Toolkit, SVG](./assets/example-pd.png)](./examples/pd.html) 12 | * Processing toolkit, compact-v style, SVG [![Compact-V Style, Processing Toolkit, SVG](./assets/example-processing-compact-v.png)](./examples/processing-compact-v.html) 13 | * Processing toolkit, compact style, SVG [![Compact Style, Processing Toolkit, SVG](./assets/example-processing-compact.png)](./examples/processing-compact.html) 14 | * Processing toolkit, plain style, SVG [![Plain Style, Processing Toolkit, SVG](./assets/example-processing-plain.png)](./examples/processing-plain.html) 15 | * Processing toolkit, quartz style, HTML [![Quartz Style, Processing Toolkitm HTML](./assets/example-processing.png)](./examples/processing.html) 16 | * Timbre toolkit, quartz style, HTML [![Quartz Style, Timbre Toolkit, HTML](./assets/example-timbre.png)](./examples/timbre.html) 17 | * Util toolkit, black-white style, SVG [![Black&White Style, Util Toolkit, SVG](./assets/example-util-black-white.png)](./examples/util-black-white.html) 18 | * Util toolkit, ableton style, SVG [![Ableton Style, Util Toolkit, SVG](./assets/example-util-ableton.png)](./examples/util-ableton.html) 19 | * Util toolkit, ableton-out style, SVG [![Ableton-Out Style, Util Toolkit, SVG](./assets/example-util-ableton-out.png)](./examples/util-ableton-out.html) 20 | * Util toolkit, blender style, SVG [![Blender Style, Util Toolkit, SVG](./assets/example-util-blender.png)](./examples/util-blender.html) 21 | * Util toolkit, compact-v style, SVG [![Compact-V Style, Util Toolkit, SVG](./assets/example-util-compact-v.png)](./examples/util-compact-v.html) 22 | * Util toolkit, quartz style, SVG [![Quartz Style, Util Toolkit, SVG](./assets/example-util-compact-v.png)](./examples/util-svg.html) 23 | * Util toolkit, quartz style, HTML [![Quartz Style, Util Toolkit, HTML](./assets/example-util.png)](./examples/util.html) 24 | 25 | 26 | 27 | #### Videos 28 | 29 | Latest Videos from [RPD Vimeo Channel](https://vimeo.com/channels/rpdjs): 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /docs/layout.jade: -------------------------------------------------------------------------------- 1 | html 2 | - var pathPrefix = '.'; 3 | - for (var i = 0; i < (front.level || 0); i++) { 4 | - pathPrefix += '/..'; 5 | - } 6 | - var homeLink = pathPrefix + '/index.html'; 7 | head 8 | meta(charset='utf-8') 9 | title RPD — #{front.title} 10 | link(href='#{pathPrefix}/highlight-js.min.css',rel='stylesheet',type='text/css') 11 | // load RPD library and requirements when document will be ready 12 | link(href='#{pathPrefix}/rpd-docs.css',rel='stylesheet',type='text/css') 13 | link(href='#{pathPrefix}/style.css',rel='stylesheet',type='text/css') 14 | script(defer,src='#{pathPrefix}/kefir.min.js') 15 | // compiled with: `gulp for-docs` 16 | script(defer,src='#{pathPrefix}/rpd-docs.min.js') 17 | body(class='rpd-docs-#{front.id}') 18 | header(id='_top') 19 | img(src='#{pathPrefix}/rpd.svg',width='30px',height='30px') 20 | h1: a(href='#{homeLink}') RPD — Reactive Patch Development 21 | div#version: span #{config.version} 22 | nav: ul 23 | each desc, id in config.contents 24 | li(class=(id === front.id ? 'active' : '')) 25 | a(href='#{pathPrefix}/#{desc.path}') #{desc.title} 26 | if desc.subsections 27 | ul 28 | each subtitle, id in desc.subsections 29 | li: a(href='#{pathPrefix}/#{desc.path}\##{id}') #{subtitle} 30 | main 31 | h2 #{front.title} 32 | article 33 | != contents 34 | div(id='jump-to-top'): a(href='#_top') ↑ 35 | footer 36 | span © shaman.sir, 2016 37 | -------------------------------------------------------------------------------- /docs/sections/events.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Subscribing to Events 3 | id: events 4 | level: 1 5 | --- 6 | 7 | 8 | 9 | ### Global Events 10 | 11 | 12 | 13 | ### Network Events 14 | 15 | * `network/add-patch`: `patch` 16 | 17 | 18 | 19 | ### Patch Events 20 | 21 | * `patch/is-ready`: _none_ 22 | * `patch/open`: `parent` 23 | * `patch/close`: _none_ 24 | * `patch/move-canvas`: `position` 25 | * `patch/resize-canvas`: `size` 26 | * `patch/set-inputs`: `inputs` 27 | * `patch/set-outputs`: `outputs` 28 | * `patch/project`: `node`, `target` 29 | * `patch/refer`: `node`, `target` 30 | * `patch/add-node`: `node` 31 | * `patch/remove-node`: `node` 32 | 33 | 34 | 35 | ### Node Events 36 | 37 | * `node/turn-on`: _none_ 38 | * `node/is-ready`: _none_ 39 | * `node/process`: `inlets`, `outlets` (not called unless Node has `process` handler) 40 | * `node/turn-off`: _none_ 41 | * `node/add-inlet`: `inlet` 42 | * `node/remove-inlet`: `inlet` 43 | * `node/add-outlet`: `outlet` 44 | * `node/remove-outlet`: `outlet` 45 | * `node/move`: `position` 46 | 47 | 48 | 49 | ### Outlet Events 50 | 51 | * `outlet/update`: `value` 52 | * `outlet/connect`: `link`, `inlet` 53 | * `outlet/disconnect`: `link` 54 | 55 | 56 | 57 | ### Inlet Events 58 | 59 | * `inlet/update`: `value` 60 | 61 | 62 | 63 | ### Link Events 64 | 65 | * `link/enable`: _none_ 66 | * `link/disable`: _none_ 67 | * `link/pass`: `value` 68 | 69 | 70 | -------------------------------------------------------------------------------- /docs/sections/participate.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Participating in Development 3 | id: participation 4 | level: 1 5 | --- 6 | 7 | Actually, to help in RPD development you just need to create a fork of the repository, and be able to compile and test it. So, please follow the instructions in the [Setup page](./setup.html) first and then run: 8 | 9 | ```sh 10 | $ npm install 11 | $ gulp get-deps 12 | $ gulp get-dev-deps 13 | $ gulp 14 | $ gulp test 15 | ``` 16 | 17 | If everything above succeeded, you may look through examples located in `/examples` folder locally, then jump through the code and actually change things, ensuring that `gulp test` passses and writing tests for new features. 18 | 19 | Currently there's no `watch` mode in RPD development flow, but all the examples in `/examples` folder use plain source code, so you may use an existing example page or add your own and just change-and-refresh. Same applies for tests. 20 | 21 | Of course, you are free to create [Issues](https://github.com/shamansir/rpd/issues) and submit [Pull Requests](https://github.com/shamansir/rpd/pulls). 22 | 23 | If you want to improve existing toolkits, please consider reading [how Toolkits are organized](./toolkits.html). 24 | 25 | Specifically, the very first need is fixing/implementing RPD issues for the [current milestone](https://github.com/shamansir/rpd/milestones), the second one is improving [WebPD Toolkit](https://github.com/shamansir/rpd/milestone/7), the third one is moving [vvvv](https://vvvv.org/) concepts to the Web with the help of RPD (there exists [vvvv.js](https://www.vvvvjs.com/), but for the moment Patch editing possibilities are very limited there). But any other things you think important are also welcome, from fixing English language in this documentation to completely rewriting RPD in [Elm](https://elm-lang.org). 26 | -------------------------------------------------------------------------------- /docs/sections/style.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Custom Styling RPD 3 | id: styling 4 | level: 1 5 | --- 6 | 7 | 8 | 9 | ### Using CSS Classes 10 | 11 | ### Writing Your Own Style 12 | 13 | ### Writing Your Own Renderer 14 | -------------------------------------------------------------------------------- /examples/anm-compact.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Animatron Toolkit 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /examples/anm-plain.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Animatron Toolkit 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /examples/anm.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Animatron Toolkit 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /examples/example.pd: -------------------------------------------------------------------------------- 1 | #N canvas 511 225 762 387 10; 2 | #X obj 127 161 dac~; 3 | #X obj 128 101 line~; 4 | #X obj 128 40 loadbang; 5 | #X msg 128 71 220; 6 | #X msg 199 70 \$1 1000; 7 | #X obj 199 40 r freq; 8 | #X obj 128 130 phasor~; 9 | #X obj 231 117 print; 10 | #X obj 368 210 s freq; 11 | #X floatatom 353 140 5 0 0 0 - - -; 12 | #X connect 1 0 6 0; 13 | #X connect 2 0 3 0; 14 | #X connect 3 0 1 0; 15 | #X connect 4 0 1 0; 16 | #X connect 4 0 7 0; 17 | #X connect 5 0 4 0; 18 | #X connect 6 0 0 0; 19 | #X connect 6 0 0 1; 20 | #X connect 9 0 8 0; 21 | -------------------------------------------------------------------------------- /examples/example.sketch.js: -------------------------------------------------------------------------------- 1 | var sketchConfig = { 2 | wavescount: 5, // Number of waves 3 | xspacing: 16, // Distance between each horizontal location 4 | amplitude: 75.0, // Height of wave 5 | period: 500.0, // How many pixels before the wave repeats 6 | startcolor: { r: 255, g: 255, b: 255 }, // Color of the first wave 7 | endcolor: { r: 255, g: 255, b: 255 }, // Color of the last wave 8 | shape: 'circle' 9 | }; 10 | 11 | var SHAPE_FUNC = { circle: function(x, y) { ellipse(x, y, 14, 14); }, 12 | rect: function(x, y) { rect(x, y, 14, 14); }, 13 | cross: function(x, y) { strokeWeight(2); 14 | line(x-7, y-7, x+7, y+7); 15 | line(x+7, y-7, x-7, y+7); 16 | strokeWeight(1); }, 17 | diamond: function(x, y) { 18 | quad(x, y-7, x+7, y, x, y+7, x-7, y); 19 | } }; 20 | 21 | var w, // Width of entire wave 22 | dx, // Value for incrementing x 23 | theta = 0.0, // Start angle at 0 24 | yvalues, // Using an array to store height values for the wave 25 | start, // start color in p5 format 26 | end, 27 | shapefunc; // end color in p5 format 28 | 29 | function setup() { 30 | var myCanvas = createCanvas(400, 300); 31 | myCanvas.parent('p5-canvas'); 32 | updateWithConfig(sketchConfig); 33 | } 34 | 35 | function draw() { 36 | background(0); 37 | calcWaves(sketchConfig); 38 | renderWaves(sketchConfig); 39 | } 40 | 41 | function updateWithConfig(conf) { 42 | w = width+16; 43 | var xspacing = (conf.xspacing > 0) ? conf.xspacing : 10, 44 | period = (conf.period > 0) ? conf.period : 500; 45 | dx = (TWO_PI / conf.period) * xspacing; 46 | yvalues = new Array(floor(w/xspacing)); 47 | start = conf.startcolor ? color(conf.startcolor.r, conf.startcolor.g, conf.startcolor.b) 48 | : color(255, 255, 255); 49 | end = conf.endcolor ? color(conf.endcolor.r, conf.endcolor.g, conf.endcolor.b) 50 | : color(255, 255, 255); 51 | shapefunc = SHAPE_FUNC[conf.shape || 'circle']; 52 | } 53 | 54 | function calcWaves(conf) { 55 | // Increment theta (try different values for 56 | // 'angular velocity' here 57 | theta += 0.02; 58 | 59 | // For every x value, calculate a y value with sine function 60 | var x = theta; 61 | for (var i = 0; i < yvalues.length; i++) { 62 | yvalues[i] = sin(x)*conf.amplitude; 63 | x+=dx; 64 | } 65 | } 66 | 67 | function renderWaves(conf) { 68 | noStroke(); 69 | var yspan = (height - 40) / conf.wavescount; 70 | var colorspan = 1 / conf.wavescount; 71 | for (var i = 0, y = 20; i < conf.wavescount; i++, y += yspan) { 72 | fill(lerpColor(start, end, colorspan * i)); 73 | stroke(lerpColor(start, end, colorspan * i)); 74 | for (var x = 0; x < yvalues.length; x++) { 75 | shapefunc(x*conf.xspacing, y+yvalues[x]); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /examples/index-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Core with Network 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /examples/network.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Core with Network 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /examples/pd.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PD Toolkit 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /examples/sandbox.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 53 | 54 | 55 | 56 | 57 |
58 | 59 |
60 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /examples/timbre.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Timbre Toolkit 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /examples/two-patches.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 64 | 65 | 66 | 67 | 68 |
69 | 70 |
71 | 72 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /examples/util-ableton-out.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /examples/util-ableton.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /examples/util-black-white.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /examples/util-blender.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /examples/util-compact-v.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /examples/util-svg.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /examples/util.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /examples/visual-history.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
52 |
53 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rpd", 3 | "version": "3.0.0-beta.2", 4 | "description": "RPD is a minimal framework for building Node-Based User Interfaces, powered by Reactive Programming", 5 | "author": "Ulric Wilfred (https://shamansir.github.io)", 6 | "homepage": "https://shamansir.github.io/rpd", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/shamansir/rpd.git" 10 | }, 11 | "bugs": { 12 | "url": "https://github.com/shamansir/rpd/issues" 13 | }, 14 | "keywords": [ 15 | "functional-reactive-programming", 16 | "reactive-programming", 17 | "node-user-interface", 18 | "dataflow-programming", 19 | "flow-based-programming", 20 | "generative-art", 21 | "graphics-programming", 22 | "pure-data", 23 | "reactive", 24 | "nodes", 25 | "streams", 26 | "reactive-streams", 27 | "user-interface", 28 | "visualisation" 29 | ], 30 | "main": "./src/rpd.js", 31 | "dependencies": { 32 | "d3-selection": "^1.0.3", 33 | "kefir": "^3.7.1" 34 | }, 35 | "devDependencies": { 36 | "del": "^2.2.0", 37 | "flow-bin": "^0.38.0", 38 | "google-closure-compiler": "^20170124.0.0", 39 | "gulp": "^3.9.0", 40 | "gulp-closure-compiler": "^0.4.0", 41 | "gulp-concat": "^2.6.0", 42 | "gulp-download": "0.0.1", 43 | "gulp-file-parser": "0.0.1", 44 | "gulp-flowcheck": "^0.4.0", 45 | "gulp-front-matter": "^1.3.0", 46 | "gulp-gzip": "^1.2.0", 47 | "gulp-header": "^1.8.8", 48 | "gulp-layout": "0.0.4", 49 | "gulp-markdown": "^1.2.0", 50 | "gulp-rename": "^1.2.2", 51 | "gulp-size": "^2.0.0", 52 | "gulp-util": "^3.0.6", 53 | "gulp-watch": "^4.3.5", 54 | "jasmine": "^2.5.3", 55 | "jasmine-core": "^2.5.2", 56 | "karma": "^1.4.1", 57 | "karma-chrome-launcher": "^2.0.0", 58 | "karma-jasmine": "^1.1.0", 59 | "karma-mocha-reporter": "^2.2.2", 60 | "karma-nyan-reporter": "^0.2.5", 61 | "through2": "^2.0.0", 62 | "yargs": ">3.25.0 <4.0.0" 63 | }, 64 | "optionalDependencies": { 65 | "codemirror": "^5.23.0", 66 | "d3": "^4.5.0", 67 | "highlight.js": "^9.9.0", 68 | "p5": "^0.5.7", 69 | "timbre": "^14.11.25", 70 | "webpd": "^0.4.2" 71 | }, 72 | "scripts": { 73 | "test": "gulp test && flow check" 74 | }, 75 | "directories": { 76 | "lib": "./src", 77 | "bin": "./src", 78 | "doc": "./docs", 79 | "example": "./examples" 80 | }, 81 | "license": "MIT" 82 | } 83 | -------------------------------------------------------------------------------- /spec/Runner.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Jasmine Spec Runner v2.3.4 6 | 7 | 8 | 9 | 10 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /spec/building/patch.spec.js: -------------------------------------------------------------------------------- 1 | describe('building: patch', function() { 2 | 3 | it('could be started both with or without a name', function() { 4 | var unnamed = Rpd.addPatch(); 5 | expect(unnamed).toBeDefined(); 6 | 7 | var named = Rpd.addPatch('some-name'); 8 | expect(named).toBeDefined(); 9 | }); 10 | 11 | it('accepts modifications without any renderer or target', function() { 12 | var patch = Rpd.addPatch(); 13 | var node = patch.addNode('spec/empty', 'Test Node'); 14 | expect(node).toBeDefined(); 15 | }); 16 | 17 | it('is not allowed to start from constructor', function() { 18 | expect(function() { 19 | new Rpd.Patch(); 20 | //}).toReportError('patch/error'); 21 | }).toThrow(); 22 | 23 | expect(function() { 24 | new Rpd.Patch('foo'); 25 | //}).toReportError('patch/error'); 26 | }).toThrow(); 27 | }); 28 | 29 | it('could be started in several instances', function() { 30 | expect(function() { 31 | Rpd.addPatch(); 32 | Rpd.addPatch(); 33 | }).not.toReportAnyError(); 34 | }); 35 | 36 | it('provides access to inner events', function() { 37 | var addNodeSpy = jasmine.createSpy('add-node'); 38 | 39 | var patch = Rpd.addPatch(); 40 | patch.event['patch/add-node'].onValue(addNodeSpy); 41 | 42 | var node = patch.addNode('spec/empty'); 43 | expect(addNodeSpy).toHaveBeenCalled(); 44 | }); 45 | 46 | describe('allows to subscribe inner events', function() { 47 | 48 | it('allows to subscribe any event', function() { 49 | 50 | var addNodeSpy = jasmine.createSpy('add-node'); 51 | 52 | var patch = Rpd.addPatch({ 53 | handle: { 54 | 'patch/add-node': addNodeSpy 55 | } 56 | }); 57 | 58 | var node = patch.addNode('spec/empty'); 59 | expect(addNodeSpy).toHaveBeenCalled(); 60 | 61 | }); 62 | 63 | it('allows to subscribe event when man specifies a name', function() { 64 | var addNodeSpy = jasmine.createSpy('add-node'); 65 | 66 | var patch = Rpd.addPatch('Foo', { 67 | handle: { 68 | 'patch/add-node': addNodeSpy 69 | } 70 | }); 71 | 72 | var node = patch.addNode('spec/empty'); 73 | expect(addNodeSpy).toHaveBeenCalled(); 74 | }); 75 | 76 | it('allows to subscribe nodes and channels events', function() { 77 | var addInletSpy = jasmine.createSpy('add-inlet'); 78 | var inletUpdateSpy = jasmine.createSpy('inlet-update'); 79 | 80 | var patch = Rpd.addPatch('Foo', { 81 | handle: { 82 | 'node/add-inlet': addInletSpy, 83 | 'inlet/update': inletUpdateSpy 84 | } 85 | }); 86 | 87 | var node = patch.addNode('spec/empty'); 88 | var inlet = node.addInlet('spec/any', 'a'); 89 | inlet.receive(42); 90 | expect(addInletSpy).toHaveBeenCalled(); 91 | expect(inletUpdateSpy).toHaveBeenCalled(); 92 | }); 93 | 94 | }); 95 | 96 | xit('subscribing to events', function() {}); 97 | 98 | xit('allows to substitute/extend renderer', function() { 99 | // i#311 100 | }); 101 | 102 | }); 103 | -------------------------------------------------------------------------------- /spec/building/render.spec.js: -------------------------------------------------------------------------------- 1 | describe('building: renderer', function() { 2 | 3 | it('target could be empty, network case', function() { 4 | Rpd.renderer('foo', function() {}); 5 | 6 | expect(function() { 7 | Rpd.renderNext('foo'); 8 | Rpd.addPatch(); 9 | }).not.toReportAnyError(); 10 | 11 | Rpd.stopRendering(); 12 | }); 13 | 14 | it('target could be empty, patch case', function() { 15 | Rpd.renderer('foo', function() {}); 16 | 17 | expect(function() { 18 | Rpd.addPatch().render('foo'); 19 | }).not.toReportAnyError(); 20 | 21 | Rpd.stopRendering(); 22 | }); 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /spec/flow/data.flow.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import Rpd from '../../rpd'; 4 | import Kefir from 'kefir'; 5 | 6 | const patch : Rpd.Patch = Rpd.addPatch('Foo'); 7 | const node1 : Rpd.Node = patch.addNode('core/any'); 8 | const node2 : Rpd.Node = patch.addNode('core/any'); 9 | 10 | const outlet: Rpd.Outlet = node1.addOutlet('core/any', 'foo4'); 11 | const inlet: Rpd.Inlet = node2.addInlet('core/any', 'foo1'); 12 | 13 | // $ExpectError 14 | outlet.stream(2); 15 | // $ExpectError 16 | outlet.stream({}); 17 | // $ExpectError 18 | outlet.stream('AA'); 19 | 20 | outlet.stream(Kefir.never()); 21 | outlet.stream(Kefir.later(100, 'a')); 22 | outlet.stream(Kefir.sequentially(100, [ 2, 3 ])); 23 | outlet.stream(Kefir.constant(0)); 24 | outlet.toDefault(); 25 | 26 | inlet.receive(2); 27 | inlet.receive({}); 28 | 29 | // $ExpectError 30 | inlet.stream(2); 31 | // $ExpectError 32 | inlet.stream({}); 33 | // $ExpectError 34 | inlet.stream('AA'); 35 | 36 | inlet.stream(Kefir.never()); 37 | inlet.stream(Kefir.later(100, 'a')); 38 | inlet.stream(Kefir.sequentially(100, [ 2, 3 ])); 39 | inlet.stream(Kefir.constant(0)); 40 | inlet.toDefault(); 41 | 42 | inlet.receive(2); 43 | inlet.receive({}); 44 | -------------------------------------------------------------------------------- /spec/flow/events.flow.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/spec/flow/events.flow.js -------------------------------------------------------------------------------- /spec/flow/network.flow.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import Rpd from '../../rpd'; 4 | 5 | const patch1: Rpd.Patch = Rpd.addPatch('Patch 1 Title'); 6 | const patch2: Rpd.Patch = Rpd.addPatch('Patch 2 Title', {}); 7 | const patch3: Rpd.Patch = Rpd.addPatch('Patch 3 Title', { 8 | handle: { 9 | 'patch/open': function() {} 10 | } 11 | }); 12 | const patch4: Rpd.Patch = Rpd.addPatch('Patch 4 Title', function() { 13 | return { }; 14 | }); 15 | const patch5: Rpd.Patch = Rpd.addPatch('Patch 5 Title', function() { 16 | return { 17 | handle: { 18 | 'patch/open': function() {} 19 | } 20 | } 21 | }); 22 | 23 | const patch6: Rpd.Patch = Rpd.addClosedPatch('Patch 6 Title'); 24 | const patch7: Rpd.Patch = Rpd.addClosedPatch('Patch 7 Title', {}); 25 | const patch8: Rpd.Patch = Rpd.addClosedPatch('Patch 8 Title', function() { 26 | return { }; 27 | }); 28 | const patch9: Rpd.Patch = Rpd.addClosedPatch('Patch 9 Title', { 29 | handle: { 30 | 'patch/open': function() {} 31 | } 32 | }); 33 | 34 | patch2.open(patch1); 35 | patch3.close(); 36 | 37 | const node1 : Rpd.Node = patch1.addNode('core/any'); 38 | const node2 : Rpd.Node = patch2.addNode('core/any', 'Node 2'); 39 | const node3 : Rpd.Node = patch3.addNode('core/any', 'Node 3'); 40 | const node4 : Rpd.Node = patch4.addNode('core/any', 'Node 4', {}); 41 | const node5 : Rpd.Node = patch5.addNode('core/any', 'Node 5', { 42 | // TODO 43 | }); 44 | const node6 : Rpd.Node = patch5.addNode('core/any', 'Node 6', function() { 45 | return {}; 46 | }); 47 | const node7 : Rpd.Node = patch5.addNode('core/any', 'Node 7', function() { 48 | return { 49 | // TODO 50 | }; 51 | }); 52 | 53 | node1.turnOn(); 54 | node1.turnOff(); 55 | 56 | patch4.project(node3); 57 | patch5.removeNode(node5); 58 | 59 | const inlet1: Rpd.Inlet = node1.addInlet('core/any', 'Inlet 1'); 60 | const inlet2: Rpd.Inlet = node1.addInlet('core/any', 'Inlet 2', {}); 61 | const inlet3: Rpd.Inlet = node1.addInlet('core/any', 'Inlet 3', { 62 | // TODO 63 | }); 64 | const inlet4: Rpd.Inlet = node1.addInlet('core/any', 'Inlet 4', function() { 65 | return {}; 66 | }); 67 | const inlet5: Rpd.Inlet = node1.addInlet('core/any', 'Inlet 5', function() { 68 | return { 69 | // TODO 70 | }; 71 | }); 72 | 73 | const outlet1: Rpd.Outlet = node1.addOutlet('core/any', 'Outlet 1'); 74 | const outlet2: Rpd.Outlet = node1.addOutlet('core/any', 'Outlet 2', {}); 75 | const outlet3: Rpd.Outlet = node1.addOutlet('core/any', 'Outlet 3', { 76 | // TODO 77 | }); 78 | const outlet4: Rpd.Outlet = node1.addOutlet('core/any', 'Outlet 4', function() { 79 | return {}; 80 | }); 81 | const outlet5: Rpd.Outlet = node1.addOutlet('core/any', 'Outlet 5', function() { 82 | return { 83 | // TODO 84 | }; 85 | }); 86 | 87 | // $ExpectError 88 | patch2.inputs([ 'aaa' ]); 89 | // $ExpectError 90 | patch2.outputs([ 'aaa' ]); 91 | 92 | patch2.inputs([ inlet1, inlet2 ]); 93 | patch2.outputs([ outlet1, outlet2 ]); 94 | 95 | // $ExpectError 96 | patch2.inputs([ outlet1, outlet2 ]); 97 | // $ExpectError 98 | patch2.outputs([ inlet1, inlet2 ]); 99 | 100 | node1.removeInlet(inlet1); 101 | node1.removeInlet(inlet2); 102 | 103 | // $ExpectError 104 | node1.removeInlet(outlet1); 105 | // $ExpectError 106 | node1.removeOutlet(inlet1); 107 | 108 | const bool: boolean = inlet3.allows(outlet1); 109 | const link: Rpd.Link = outlet1.connect(inlet3); 110 | outlet1.disconnect(link); 111 | 112 | link.enable(); 113 | link.disable(); 114 | link.disconnect(); 115 | 116 | // $ExpectError 117 | outlet1.disconnect(); 118 | // $ExpectError 119 | outlet1.allows(inlet3); 120 | // $ExpectError 121 | inlet3.connect(outlet1); 122 | 123 | 124 | -------------------------------------------------------------------------------- /spec/flow/registration.flow.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import Rpd from '../../rpd'; 4 | import Kefir from 'kefir'; 5 | 6 | const simpleNodeDefinition = { 7 | title: 'Test' 8 | }; 9 | 10 | const fullNodeDefinition = { 11 | title: 'Foobar', 12 | inlets: { 'test/a': { type: 'core/any', default: 5 }, 13 | 'test/b': { type: 'core/any', allow: [ 'util/number' ] } }, 14 | 'test/c': { type: 'core/any', default: 'foobar' /*Kefir.later(1500, 'a')*/ }, 15 | outlets: { 'test/a': { type: 'core/any' }, 16 | 'test/b': { type: 'core/any', show: function(v) { return v } } }, 17 | prepare: function(inlets, outlets) {}, 18 | process: function(inlets_vals, prev_inlets_vals) { 19 | return { 20 | 'test/a': 17, 21 | 'test/b': Kefir.constant(3) 22 | }; 23 | }, 24 | tune: function(stream) { return stream.delay(100); }, 25 | handle: { 26 | 'node/turn-on': function() {} 27 | } 28 | }; 29 | 30 | Rpd.nodetype('spec/test', { }); 31 | Rpd.nodetype('spec/test', simpleNodeDefinition); 32 | Rpd.nodetype('spec/test', function() { 33 | return simpleNodeDefinition; 34 | }); 35 | Rpd.nodetype('spec/test', fullNodeDefinition); 36 | Rpd.nodetype('spec/test', function() { 37 | return fullNodeDefinition; 38 | }); 39 | 40 | const simpleChannelDefinition = { 41 | label: 'test' 42 | }; 43 | 44 | const allowList: Array = [ 'util/number', 'core/any' ]; 45 | 46 | const fullChannelDefinition = { 47 | type: 'core/any', 48 | label: 'foobar', 49 | default: 12, //Kefir.later(1500, 'a'), 50 | hidden: true, 51 | cold: true, 52 | readonly: true, 53 | allow: allowList, 54 | accept: function(v): boolean { return true; }, 55 | adapt: function(v): any { return v; }, 56 | show: function(v): string { return 'v'; }, 57 | tune: function(stream: Kefir.Observable<*>): Kefir.Observable<*> { return stream.delay(100); }, 58 | handle: { 59 | 'node/turn-on': function() {} 60 | } 61 | }; 62 | 63 | Rpd.channeltype('spec/test', { }); 64 | Rpd.channeltype('spec/test', simpleChannelDefinition); 65 | Rpd.channeltype('spec/test', function() { 66 | return simpleChannelDefinition; 67 | }); 68 | Rpd.channeltype('spec/test', fullChannelDefinition); 69 | Rpd.channeltype('spec/test', function() { 70 | return fullChannelDefinition; 71 | }); 72 | 73 | const simpleNodeRendererDefinition = { 74 | size: { width: 10, height: 10 } 75 | }; 76 | 77 | const fullNodeRendererDefinition = { 78 | size: { width: 10, height: 10 }, 79 | first: function(body) { 80 | return { 81 | inlet: { 82 | default: 17, 83 | valueOut: Kefir.later(100, 'a') 84 | }, 85 | anotherInlet: { 86 | default: 17, 87 | valueOut: Kefir.later(100, 'a') 88 | } 89 | } 90 | }, 91 | always: function(body, inlets, outlets) {} 92 | }; 93 | 94 | Rpd.noderenderer('spec/test', 'foo', {}); 95 | Rpd.noderenderer('spec/test', 'foo', simpleNodeRendererDefinition); 96 | Rpd.noderenderer('spec/test', 'foo', function() { 97 | return simpleNodeRendererDefinition; 98 | }); 99 | Rpd.noderenderer('spec/test', 'foo', fullNodeRendererDefinition); 100 | Rpd.noderenderer('spec/test', 'foo', function() { 101 | return fullNodeRendererDefinition; 102 | }); 103 | 104 | const channelRendererDefinition = { 105 | show: function(body: HTMLElement, value: any, repr: string) {}, 106 | edit: function(body: HTMLElement, inlet: Rpd.Inlet, valueIn: Kefir.Observable<*>): Kefir.Observable<*> { 107 | return Kefir.interval(500, '42') 108 | } 109 | }; 110 | 111 | Rpd.channelrenderer('spec/test', 'foo', {}); 112 | Rpd.channelrenderer('spec/test', 'foo', channelRendererDefinition); 113 | Rpd.channelrenderer('spec/test', 'foo', function() { 114 | return channelRendererDefinition; 115 | }); 116 | 117 | Rpd.nodedescription('spec/test', 'The Description'); 118 | Rpd.nodetypeicon('spec/test', '*'); 119 | Rpd.toolkiticon('foobar', '*'); 120 | 121 | // TODO: Rpd.renderer 122 | // TODO: Rpd.style 123 | 124 | -------------------------------------------------------------------------------- /spec/flow/render.flow.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import Rpd from '../../rpd'; 4 | 5 | let twoDivs: Array = [ document.createElement('div'), 6 | document.createElement('div') ]; 7 | 8 | Rpd.renderNext('html', '#some-id'); 9 | Rpd.renderNext('html', document.createElement('div')); 10 | Rpd.renderNext([ 'html', 'svg' ], '#some-id'); 11 | Rpd.renderNext('svg', twoDivs); 12 | Rpd.renderNext('html', '#some-id', {}); 13 | Rpd.renderNext('html', '#some-id', { 14 | // TODO 15 | }); 16 | Rpd.renderNext('html', '#some-id', {}); 17 | Rpd.renderNext('html', '#some-id', { 18 | valuesOnHover: true 19 | }); 20 | Rpd.stopRendering(); 21 | 22 | Rpd.addPatch('Foobar').render('html', '#some-id'); 23 | Rpd.addPatch('Foobar').render('html', document.createElement('div')); 24 | Rpd.addPatch('Foobar').render([ 'html', 'svg' ], '#some-id'); 25 | Rpd.addPatch('Foobar').render('svg', twoDivs); 26 | Rpd.addPatch('Foobar').render('html', '#some-id', {}) 27 | Rpd.addPatch('Foobar').render('html', '#some-id', { 28 | valuesOnHover: true 29 | }); 30 | Rpd.addPatch('Foobar').render('html', '#some-id', function() { 31 | return {}; 32 | }); 33 | Rpd.addPatch('Foobar').render('html', '#some-id', function() { 34 | return { 35 | title: 'Foobar', 36 | handle: { 37 | 'patch/open': function() {} 38 | } 39 | }; 40 | }); 41 | const patch : Rpd.Patch = Rpd.addPatch('Foobar'); 42 | patch.moveCanvas(10, 20) 43 | .open(Rpd.addPatch()) 44 | .resizeCanvas(100, 200) 45 | .close(); 46 | patch.addNode('core/any').move(10, 20).turnOff(); 47 | -------------------------------------------------------------------------------- /spec/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration 2 | // Generated on Sat Jun 20 2015 01:21:00 GMT+0200 (CEST) 3 | 4 | module.exports = function(config) { 5 | 6 | var options = { 7 | 8 | // base path that will be used to resolve all patterns (eg. files, exclude) 9 | basePath: '..', 10 | 11 | 12 | // frameworks to use 13 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter 14 | frameworks: ['jasmine'], 15 | 16 | 17 | // list of files / patterns to load in the browser 18 | files: [ 19 | './node_modules/kefir/dist/kefir.min.js', 20 | 21 | './src/rpd.js', 22 | './src/io/json.js', 23 | './src/io/plain.js', 24 | './src/navigation/browser.js', 25 | 26 | './spec/matchers.js', 27 | './spec/prettify.js', 28 | './spec/prepare.js', 29 | 30 | './spec/building/network.spec.js', 31 | './spec/building/patch.spec.js', 32 | './spec/building/node.spec.js', 33 | './spec/building/inlet.spec.js', 34 | './spec/building/outlet.spec.js', 35 | './spec/building/link.spec.js', 36 | './spec/building/render.spec.js', 37 | 38 | './spec/registration/general.spec.js', 39 | 40 | './spec/registration/nodetype.spec.js', 41 | './spec/registration/channeltype.spec.js', 42 | 43 | './spec/registration/noderenderer.spec.js', 44 | './spec/registration/channelrenderer.spec.js', 45 | 46 | './spec/registration/renderer.spec.js', 47 | //'./spec/registration/subrenderer.spec.js', 48 | 49 | //'./spec/history.spec.js', 50 | './spec/io.spec.js', 51 | './spec/navigation.spec.js' 52 | 53 | ], 54 | 55 | 56 | // list of files to exclude 57 | exclude: [ 58 | ], 59 | 60 | 61 | // preprocess matching files before serving them to the browser 62 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 63 | preprocessors: { 64 | }, 65 | 66 | 67 | // test results reporter to use 68 | // possible values: 'dots', 'progress' 69 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter 70 | reporters: ['nyan'], 71 | 72 | 73 | // web server port 74 | port: 9876, 75 | 76 | 77 | // enable / disable colors in the output (reporters and logs) 78 | colors: true, 79 | 80 | 81 | // level of logging 82 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 83 | logLevel: config.LOG_INFO, 84 | 85 | 86 | // enable / disable watching file and executing tests whenever any file changes 87 | autoWatch: false, 88 | 89 | 90 | // start these browsers 91 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 92 | browsers: ['Chrome'], 93 | 94 | customLaunchers: { 95 | 'Chrome_travis_ci': { 96 | base: 'Chrome', 97 | flags: ['--no-sandbox'] 98 | } 99 | }, 100 | 101 | // Continuous Integration mode 102 | // if true, Karma captures browsers, runs the tests and exits 103 | singleRun: false 104 | 105 | }; 106 | 107 | if (process.env.TRAVIS) { 108 | options.browsers = ['Chrome_travis_ci']; 109 | options.reporters = ['mocha']; 110 | } 111 | 112 | config.set(options); 113 | 114 | }; 115 | -------------------------------------------------------------------------------- /spec/prepare.js: -------------------------------------------------------------------------------- 1 | prettify(Rpd); // inject pretty-print for Jasmine 2 | 3 | Rpd.nodetype('spec/empty', {}); 4 | Rpd.channeltype('spec/any', {}); 5 | 6 | function withNewPatch(name, fn) { 7 | if (!fn) { fn = name; name = '' }; 8 | var updateSpy = jasmine.createSpy('update' + (name ? ('-' + name) : '')); 9 | var patch = Rpd.addPatch(); 10 | 11 | patch.events.onValue(updateSpy) 12 | 13 | fn(patch, updateSpy); 14 | } 15 | 16 | // this function is required due to the fact processing function receives the same object 17 | // modified through time, so if these checks are preformed after the calls, they do fail 18 | // see: https://github.com/shamansir/rpd/issues/89 19 | // and: https://github.com/jasmine/jasmine/issues/872 20 | function handleNextCalls(spy, handlers) { 21 | var timesCalled = 0; 22 | 23 | spy.and.callFake(function() { 24 | expect(handlers[timesCalled]).toBeTruthy('No handler for a call #' + timesCalled); 25 | handlers[timesCalled](spy); 26 | timesCalled++; 27 | }); 28 | 29 | return function() { 30 | expect(spy).toHaveBeenCalledTimes(handlers.length); 31 | } 32 | } 33 | 34 | beforeEach(function() { 35 | jasmine.addMatchers({ 36 | toHaveBeenOrderlyCalledWith: RpdMatchers.toHaveBeenOrderlyCalledWith, 37 | toHaveBeenCalledOnce: RpdMatchers.toHaveBeenCalledOnce, 38 | toHaveBeenCalledTwice: RpdMatchers.toHaveBeenCalledTwice, 39 | toHaveBeenCalledTimes: RpdMatchers.toHaveBeenCalledTimes, 40 | toReportError: RpdMatchers.toReportError, 41 | toReportAnyError: RpdMatchers.toReportAnyError 42 | }); 43 | }); 44 | -------------------------------------------------------------------------------- /spec/prettify.js: -------------------------------------------------------------------------------- 1 | ;(function(global) { 2 | 3 | function prettify(Rpd) { 4 | if (Rpd.PRETTIFIED) return; 5 | 6 | Rpd._.Patch.prototype.jasmineToString = function() { 7 | return Rpd.stringify.patch(this); 8 | } 9 | 10 | Rpd._.Node.prototype.jasmineToString = function() { 11 | return Rpd.stringify.node(this); 12 | } 13 | 14 | Rpd._.Inlet.prototype.jasmineToString = function() { 15 | return Rpd.stringify.inlet(this); 16 | } 17 | 18 | Rpd._.Outlet.prototype.jasmineToString = function() { 19 | return Rpd.stringify.outlet(this); 20 | } 21 | 22 | Rpd._.Link.prototype.jasmineToString = function() { 23 | return Rpd.stringify._link(this); 24 | } 25 | 26 | Rpd.PRETTIFIED = true; 27 | } 28 | 29 | if (typeof define === 'function' && define.amd) { 30 | define([], function() { return prettify; }); 31 | global.prettify = prettify; 32 | } else if (typeof module === "object" && typeof exports === "object") { 33 | module.exports = prettify; 34 | } else { 35 | global.prettify = prettify; 36 | } 37 | 38 | })(this); 39 | -------------------------------------------------------------------------------- /spec/registration/general.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/rpd/6aebf8bf7e238e3bb1576f64f2fb475bf7c116e7/spec/registration/general.spec.js -------------------------------------------------------------------------------- /src/io/pd.js: -------------------------------------------------------------------------------- 1 | ;(function(global) { 2 | "use strict"; 3 | 4 | var Rpd = global.Rpd; 5 | if (typeof Rpd === "undefined" && typeof require !== "undefined") { 6 | Rpd = require('rpd'); 7 | } 8 | 9 | // ================================= EXPORT ================================= 10 | 11 | Rpd.export.pd = function(name) { 12 | var spec = exportSpec; 13 | 14 | var commands = []; 15 | var lines = []; 16 | 17 | var moves = {}; 18 | 19 | Rpd.events.onValue(function() { 20 | 21 | }); 22 | 23 | return function() { 24 | return lines.join('\r\n'); 25 | }; 26 | } 27 | 28 | // ================================= IMPORT ================================= 29 | 30 | Rpd.import.pd = function(lines) { 31 | 32 | var WebPd = global.Pd || null; 33 | 34 | if (!WebPd) throw new Error('WebPd is required to import PD files'); 35 | 36 | var patchData = WebPd.parsePatch(lines); 37 | var webPdPatch = WebPd.loadPatch(patchData); 38 | 39 | var nodes = []; 40 | 41 | var rootPatch = Rpd.addPatch('PD'); 42 | var model = new PdModel(rootPatch, webPdPatch); // it is wrong to do it here as well 43 | // since PdModel is defined for toolkit, 44 | // not the import 45 | rootPatch.model = model; 46 | 47 | var nodeToInlets = {}, 48 | nodeToOutlets = {}, 49 | nodeToProto = {}; 50 | 51 | function pushInlet(update) { 52 | if (update.inlet.def.hidden) return; 53 | if (!nodeToInlets[update.node.id]) nodeToInlets[update.node.id] = []; 54 | nodeToInlets[update.node.id].push(update.inlet); 55 | } 56 | function pushOutlet(update) { 57 | if (!nodeToOutlets[update.node.id]) nodeToOutlets[update.node.id] = []; 58 | nodeToOutlets[update.node.id].push(update.outlet); 59 | } 60 | function popInlet(update) { nodeToInlets[update.node.id].pop(); } 61 | function popOutlet(update) { nodeToOutlets[update.node.id].pop(); } 62 | 63 | function eventIs(type) { return function(event) { return event.type === type; } }; 64 | 65 | var addInletStream = rootPatch.events.filter(eventIs('node/add-inlet')) 66 | .filter(function(event) { return !event.inlet.hidden; }); 67 | var addOutletStream = rootPatch.events.filter(eventIs('node/add-outlet')); 68 | var removeInletStream = rootPatch.events.filter(eventIs('node/remove-inlet')); 69 | var removeOutletStream = rootPatch.events.filter(eventIs('node/remove-outlet')); 70 | 71 | addInletStream.onValue(pushInlet); addOutletStream.onValue(pushOutlet); 72 | removeInletStream.onValue(popInlet); removeOutletStream.onValue(popOutlet); 73 | 74 | var cmdToType = PdModel.COMMAND_TO_TYPE; 75 | patchData.nodes.forEach(function(pdNode, idx) { 76 | var proto = pdNode.proto, 77 | nodeType = cmdToType[proto]; 78 | var node = rootPatch.addNode(nodeType || 'wpd/object'); 79 | nodeToProto[node.id] = proto; 80 | node.move(pdNode.layout.x, pdNode.layout.y); 81 | // node.webPdObject = webPdPatch.objects[idx]; 82 | model.markResolvedAndApply(node, proto, pdNode.args, webPdPatch.objects[idx]); 83 | nodes.push(node); 84 | }); 85 | 86 | patchData.connections.forEach(function(connection) { 87 | var fromNodeIdx = connection.source.id, 88 | toNodeIdx = connection.sink.id; 89 | var outletIdx = connection.source.port, 90 | inletIdx = connection.sink.port; 91 | var fromNode = nodes[fromNodeIdx], 92 | toNode = nodes[toNodeIdx]; 93 | if (nodeToOutlets[fromNode.id] && nodeToInlets[toNode.id]) { 94 | var outlet = nodeToOutlets[fromNode.id][outletIdx], 95 | inlet = nodeToInlets[toNode.id][inletIdx]; 96 | if (!inlet.allows(outlet)) { 97 | // FIXME: actually, a dirty hack 98 | console.warn('Different types of channels were encountered while connecting', 99 | 'from', nodeToProto[fromNode.id], 'outlet', outletIdx, outlet.type, 100 | 'to', nodeToProto[toNode.id], 'inlet', inletIdx, inlet.type, 101 | ', rewriting the outlet type'); 102 | outlet.type = inlet.type; 103 | } 104 | if (inlet && outlet) { outlet.connect(inlet); } 105 | else { console.error('Failed to connect object ' + fromNodeIdx + ' to object ' + toNodeIdx); }; 106 | } else { console.error('Failed to connect object ' + fromNodeIdx + ' to object ' + toNodeIdx); }; 107 | }); 108 | 109 | addInletStream.offValue(pushInlet); addOutletStream.offValue(pushOutlet); 110 | removeInletStream.offValue(popInlet); removeOutletStream.offValue(popOutlet); 111 | 112 | model.listenForNewNodes(); 113 | 114 | return rootPatch; 115 | 116 | } 117 | 118 | }(this)); 119 | -------------------------------------------------------------------------------- /src/modules/visual-history.css: -------------------------------------------------------------------------------- 1 | .visual-history { 2 | position: absolute; 3 | width: 400px; 4 | height: 100%; 5 | top: 0; 6 | right: 0; 7 | z-index: 10; 8 | overflow-y: scroll; 9 | font-family: "Fira Code", "Fira Sans", Menlo, "Courier New", sans-serif; 10 | font-size: 10px; 11 | } 12 | 13 | .visual-history > ul.list { 14 | margin: 0; 15 | padding: 0; 16 | list-style-type: none; 17 | background-color: darkcyan; 18 | display: flex; 19 | flex-direction: column-reverse; 20 | } 21 | 22 | .visual-history > ul.list > li { 23 | border-radius: 4px; 24 | border: 1px solid rgba(255, 255, 255, 0.5); 25 | padding: 3px; 26 | margin: 2px; 27 | flex: 0 0 auto; 28 | } 29 | 30 | .visual-history .update-type { 31 | border-radius: 3px; 32 | margin: -2px 2px 2px -2px; 33 | padding: 2px; 34 | background-color: black; 35 | color: white; 36 | } 37 | 38 | .visual-history .update-details { 39 | display: inline; 40 | padding-left: 3px; 41 | } 42 | 43 | .visual-history > ul.filter { 44 | margin: 0; 45 | padding: 0; 46 | list-style-type: none; 47 | background-color: darkslategray; 48 | font-size: 9px; 49 | } 50 | 51 | .visual-history > ul.filter > li { 52 | display: inline-block; 53 | border-radius: 4px; 54 | border: 1px solid rgba(255, 255, 255, 0.5); 55 | padding: 3px; 56 | margin: 2px; 57 | color: white; 58 | } 59 | 60 | .visual-history > ul.filter > li input { 61 | margin-left: 5px; 62 | } 63 | 64 | .visual-history .counter { 65 | background-color: black; 66 | color: white; 67 | text-align: center; 68 | padding: 5px 0; 69 | border-radius: 10px 10px 0 0; 70 | } 71 | -------------------------------------------------------------------------------- /src/navigation/browser.js: -------------------------------------------------------------------------------- 1 | ;(function(global) { 2 | "use strict"; 3 | 4 | var Rpd = global.Rpd; 5 | if (typeof Rpd === "undefined" && typeof require !== "undefined") { 6 | Rpd = require('rpd'); 7 | } 8 | 9 | Rpd.navigation = (function() { 10 | 11 | var SEPARATOR = '+'; 12 | 13 | function Navigation() { 14 | this.onNewPatch = function(patch) { 15 | if (!this.firstAddedPatch) this.firstAddedPatch = patch; 16 | this.idToPatch[patch.id] = patch; 17 | this.idToOpenness[patch.id] = false; 18 | }.bind(this); 19 | 20 | this.onOpenedPatch = function(patch) { 21 | if (this.handlingPathLock) return; 22 | if (this.openedPatches.indexOf(patch.id) < 0) { 23 | this.openedPatches.push(patch.id); 24 | } 25 | this.idToOpenness[patch.id] = true; 26 | this.changePath(this.openedPatches.join(SEPARATOR)); 27 | }.bind(this); 28 | 29 | this.onClosedPatch = function(patch) { 30 | if (this.handlingPathLock) return; 31 | var pos = this.openedPatches.indexOf(patch.id); 32 | if (pos >= 0) this.openedPatches.splice(pos, 1); 33 | this.idToOpenness[patch.id] = false; 34 | this.changePath(this.openedPatches.join(SEPARATOR)); 35 | }.bind(this); 36 | 37 | this.onHashChange = function(hash) { 38 | this.handlePath(hash || ''); 39 | }.bind(this); 40 | } 41 | 42 | Navigation.prototype.reset = function() { 43 | this.lastPath = ''; 44 | 45 | this.idToPatch = {}; 46 | this.idToOpenness = {}; 47 | 48 | this.firstAddedPatch = undefined; 49 | this.handlingPathLock = false; 50 | 51 | this.openedPatches = []; 52 | } 53 | 54 | Navigation.prototype.enable = function() { 55 | this.reset(); 56 | Rpd.event['network/add-patch'].onValue(this.onNewPatch); 57 | this.openedPatchesStream = Rpd.events.filter(function(event) { return event.type === 'patch/open'; }) 58 | .map(function(event) { return event.patch; }); 59 | this.openedPatchesStream.onValue(this.onOpenedPatch); 60 | this.closedPatchesStream = Rpd.events.filter(function(event) { return event.type === 'patch/close'; }) 61 | .map(function(event) { return event.patch; }); 62 | this.closedPatchesStream.onValue(this.onClosedPatch); 63 | this.hashChangeStream = Kefir.fromEvents(window, 'hashchange') 64 | .map(function() { return (window.location.hash ? window.location.hash.slice(1) : null); }); 65 | this.hashChangeStream.onValue(this.onHashChange); 66 | } 67 | 68 | Navigation.prototype.disable = function() { 69 | Rpd.event['network/add-patch'].offValue(this.onNewPatch); 70 | this.openedPatchesStream.offValue(this.onOpenedPatch); 71 | this.closedPatchesStream.offValue(this.onClosedPatch); 72 | this.hashChangeStream.offValue(this.onHashChange); 73 | } 74 | 75 | Navigation.prototype.changePath = function(path) { 76 | this.lastPath = path; 77 | window.location.hash = path; 78 | } 79 | 80 | Navigation.prototype.handlePath = function(path) { 81 | this.handlingPathLock = true; 82 | if (!path && this.firstAddedPatch) { 83 | path = this.firstAddedPatch.id; 84 | this.changePath(path); 85 | } 86 | var idList = path.split(SEPARATOR); 87 | var lenBefore = idList.length; 88 | idList = idList.filter(function(patchId) { 89 | if (patchId && !this.idToPatch[patchId]) { 90 | Rpd.reportError(null, 'network', 'unknown patch ID ' + patchId); 91 | } 92 | return patchId && this.idToPatch[patchId]; 93 | }.bind(this)); 94 | if (idList.length == 0) { 95 | if (this.firstAddedPatch) { 96 | idList = [ this.firstAddedPatch.id ]; 97 | this.changePath(this.firstAddedPatch.id); 98 | } else { 99 | Rpd.reportError(null, 'network', 'unknown path requested: ' + path); 100 | } 101 | } 102 | //var newPath = idList.join(SEPARATOR); 103 | this.openedPatches.forEach(function(patchId) { 104 | if ((idList.indexOf(patchId) < 0) && this.idToOpenness[patchId]) { 105 | this.idToPatch[patchId].close(); 106 | this.idToOpenness[patchId] = false; 107 | } 108 | }.bind(this)); 109 | idList.forEach(function(patchId) { 110 | if (!this.idToOpenness[patchId]) { 111 | this.idToPatch[patchId].open(); 112 | this.idToOpenness[patchId] = true; 113 | } 114 | }.bind(this)); 115 | this.openedPatches = idList; 116 | if (lenBefore !== idList.length) { 117 | this.changePath(idList.join(SEPARATOR)); 118 | } 119 | this.handlingPathLock = false; 120 | } 121 | 122 | return new Navigation(); 123 | 124 | })(); 125 | 126 | }(this)); 127 | -------------------------------------------------------------------------------- /src/render/css.schema: -------------------------------------------------------------------------------- 1 | .rpd-network .rpd-full-page? 2 | 3 | .rpd-canvas* .rpd-style-