@peter.prib/renderengine 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/REFERENCE.md +7 -0
- package/dist/renderengine-workspace.umd.js +2455 -2403
- package/dist/renderengine.umd.js +2455 -2403
- package/examples/diagram-editor.html +9 -4
- package/package.json +3 -2
- package/src/BaseRenderer.js +11 -0
- package/src/CanvasRenderer.js +7 -0
- package/src/SVGRenderer.js +16 -0
- package/src/charting/templates/Template.js +0 -6
- package/src/index.js +2659 -2635
package/README.md
CHANGED
|
@@ -7,6 +7,8 @@ Open an Archi model, edit it the way you would in Archi, and save it back to the
|
|
|
7
7
|
installing anything. Or put the same editor in your own app: it's a JavaScript library and a set of workbench parts,
|
|
8
8
|
not a desktop application.
|
|
9
9
|
|
|
10
|
+

|
|
11
|
+
|
|
10
12
|
---
|
|
11
13
|
|
|
12
14
|
## Try it
|
|
@@ -121,6 +123,8 @@ of them for its own palettes:
|
|
|
121
123
|
|
|
122
124
|
Each model can hold several diagrams, with line styles inherited from the diagram, then the model, then the tool.
|
|
123
125
|
|
|
126
|
+

|
|
127
|
+
|
|
124
128
|
## The chart library
|
|
125
129
|
|
|
126
130
|
The engine underneath draws 24 chart types: bar, line, area, pie, scatter, bubble, heatmap, candlestick,
|
|
@@ -128,6 +132,10 @@ waterfall, histogram, box plot, violin, radar, funnel, treemap, sunburst, gauges
|
|
|
128
132
|
draws graph and railroad diagrams, all to SVG or Canvas. `test/charts.html` is the full gallery, and
|
|
129
133
|
`examples/csv-chart-builder.html` builds a chart from a CSV file without code.
|
|
130
134
|
|
|
135
|
+

|
|
136
|
+
|
|
137
|
+

|
|
138
|
+
|
|
131
139
|
---
|
|
132
140
|
|
|
133
141
|
## Put it in your own page
|
|
@@ -189,6 +197,7 @@ UI at all.
|
|
|
189
197
|
npm install # dev tools only: Rollup
|
|
190
198
|
npm run build # dist/renderengine.umd.js and dist/renderengine-workspace.umd.js
|
|
191
199
|
npm test # Node's built-in test runner, no browser needed
|
|
200
|
+
npm run screenshots # this README's pictures, from the example pages (headless Chrome)
|
|
192
201
|
```
|
|
193
202
|
|
|
194
203
|
There are two bundles:
|
package/REFERENCE.md
CHANGED
|
@@ -27,6 +27,13 @@ const headless = new RenderEngine(null); // test mode — every chart call no-op
|
|
|
27
27
|
a 3D-orbit chart's own drag-to-rotate/wheel-to-zoom takes over instead — see below).
|
|
28
28
|
- Both renderers sit behind one primitive API (`rect`/`circle`/`path`/`text`/`line`/…) — every
|
|
29
29
|
`Chart` subclass is renderer-agnostic, so any `xChart()` call below works unchanged under either.
|
|
30
|
+
- **Size.** The renderer takes the container's size once, when the engine is made. Call
|
|
31
|
+
`engine.fitToContainer()` before drawing in a container that may since have been resized or
|
|
32
|
+
was hidden then (it measured 0×0): it re-measures and resizes the renderer, returning whether
|
|
33
|
+
the size changed, and does nothing while the container is still 0×0. An SVG diagram that set
|
|
34
|
+
its own viewBox keeps it and scales into the new box; a canvas is cleared, so draw after.
|
|
35
|
+
Without it, a drawing made in a narrower or hidden pane stayed that size — clipped, or blank
|
|
36
|
+
until the page was reloaded.
|
|
30
37
|
|
|
31
38
|
## The rendering model (read this before the streaming section)
|
|
32
39
|
|