apexsankey 1.11.1 → 1.12.1
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 +53 -0
- package/apexsankey.d.ts +9 -0
- package/apexsankey.es.min.js +1 -1
- package/apexsankey.min.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -425,3 +425,56 @@ const data = {
|
|
|
425
425
|
},
|
|
426
426
|
};
|
|
427
427
|
```
|
|
428
|
+
|
|
429
|
+
## Family theme tokens (`--apx-*`)
|
|
430
|
+
|
|
431
|
+
Every chart in the ApexCharts family reads the same five root tokens, so a page can state its brand once and have trees, flow diagrams, Gantt charts and plots all follow:
|
|
432
|
+
|
|
433
|
+
| Token | Role |
|
|
434
|
+
| ----------------------------------- | ---------------------------------------------------------------- |
|
|
435
|
+
| `--apx-accent` | The colour that means interactive or selected |
|
|
436
|
+
| `--apx-fore` | Text and anything that must stay legible on the surface |
|
|
437
|
+
| `--apx-grid` | Hairlines: borders, gridlines, connectors |
|
|
438
|
+
| `--apx-surface` | The plane content sits on |
|
|
439
|
+
| `--apx-series-1` … `--apx-series-N` | An ordered categorical palette (1-based, stops at the first gap) |
|
|
440
|
+
|
|
441
|
+
```css
|
|
442
|
+
:root {
|
|
443
|
+
--apx-accent: #5b21b6;
|
|
444
|
+
--apx-fore: #101828;
|
|
445
|
+
--apx-grid: #e4e7ec;
|
|
446
|
+
--apx-surface: #ffffff;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
@media (prefers-color-scheme: dark) {
|
|
450
|
+
:root {
|
|
451
|
+
--apx-fore: #f8fafc;
|
|
452
|
+
--apx-grid: #334155;
|
|
453
|
+
--apx-surface: #0f172a;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
Custom properties inherit, so declaring them on `:root` reaches every chart on the page. They resolve **below anything you configured explicitly**, so adopting them cannot change a chart that was already themed:
|
|
459
|
+
|
|
460
|
+
```
|
|
461
|
+
product CSS variable > explicit option > --apx-* token > built-in default
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
An option set to a value equal to its built-in default is indistinguishable from one left alone, and the token wins there. Set a product variable if you need a value pinned regardless.
|
|
465
|
+
|
|
466
|
+
### Named themes
|
|
467
|
+
|
|
468
|
+
`registerTheme` from `@apex/commons` records a named set of tokens on a registry shared by the whole family, so a brand theme registered once from any product is resolvable by name from all of them:
|
|
469
|
+
|
|
470
|
+
```js
|
|
471
|
+
import {registerTheme} from '@apex/commons';
|
|
472
|
+
|
|
473
|
+
registerTheme('acme', {
|
|
474
|
+
tokens: {accent: '#5b21b6', fore: '#101828', grid: '#e4e7ec', surface: '#ffffff'},
|
|
475
|
+
});
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
A named theme's tokens sit one layer below the CSS `--apx-*` tokens, so the cascade still wins over the registry.
|
|
479
|
+
|
|
480
|
+
Reference it through the `theme` option, alongside the Sankey-specific named themes described in [Themes](#themes). The two registries are complementary: a Sankey theme carries diagram-specific defaults (palette, edge opacity, canvas style), while a family theme carries the cross-product token roles.
|
package/apexsankey.d.ts
CHANGED
|
@@ -1024,6 +1024,15 @@ declare class SankeyGraphRenderer extends Paper {
|
|
|
1024
1024
|
* animation, relayout, drag, or particle layer in this mode (v1).
|
|
1025
1025
|
*/
|
|
1026
1026
|
private renderChord;
|
|
1027
|
+
/**
|
|
1028
|
+
* Release everything that outlives a render: the relayout/morph driver, the
|
|
1029
|
+
* particle layer, drag handlers and the a11y helper.
|
|
1030
|
+
*
|
|
1031
|
+
* The motion driver is the one that matters here. It owns a rAF loop, and a
|
|
1032
|
+
* diagram destroyed mid-morph would otherwise keep ticking and redrawing into
|
|
1033
|
+
* a detached layer for as long as its springs took to settle.
|
|
1034
|
+
*/
|
|
1035
|
+
destroy(): void;
|
|
1027
1036
|
/**
|
|
1028
1037
|
* Update the diagram to new data. When the new layout shares the current
|
|
1029
1038
|
* topology (same nodes, edges and edge routing) the change is spring-animated:
|