@opendata-ai/openchart-core 9.2.2 → 9.2.3
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/dist/index.d.ts +15 -15
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
- package/schema/chart.schema.json +2 -2
- package/schema/table.schema.json +2 -2
- package/schema/vizspec.schema.json +30 -30
package/dist/index.d.ts
CHANGED
|
@@ -1953,7 +1953,7 @@ interface ChartLayout {
|
|
|
1953
1953
|
};
|
|
1954
1954
|
/** Resolved animation config. Present only when animation is enabled. */
|
|
1955
1955
|
animation?: ResolvedAnimation;
|
|
1956
|
-
/** Whether the
|
|
1956
|
+
/** Whether the OpenChart watermark is enabled. */
|
|
1957
1957
|
watermark: boolean;
|
|
1958
1958
|
/** Display mode controlling chrome/axes/legend stripping. `'sparkline'` produces an edge-to-edge mini chart. */
|
|
1959
1959
|
display: Display;
|
|
@@ -2166,7 +2166,7 @@ interface TableLayout {
|
|
|
2166
2166
|
theme: ResolvedTheme;
|
|
2167
2167
|
/** Resolved animation config. Present only when animation is enabled. */
|
|
2168
2168
|
animation?: ResolvedAnimation;
|
|
2169
|
-
/** Whether the
|
|
2169
|
+
/** Whether the OpenChart watermark is enabled. */
|
|
2170
2170
|
watermark: boolean;
|
|
2171
2171
|
}
|
|
2172
2172
|
/** A resolved graph node with computed position and visual properties. */
|
|
@@ -2348,7 +2348,7 @@ interface SankeyLayout {
|
|
|
2348
2348
|
};
|
|
2349
2349
|
/** Resolved animation config. Present only when animation is enabled. */
|
|
2350
2350
|
animation?: ResolvedAnimation;
|
|
2351
|
-
/** Whether the
|
|
2351
|
+
/** Whether the OpenChart watermark is enabled. */
|
|
2352
2352
|
watermark: boolean;
|
|
2353
2353
|
/** Real text measurement function from the adapter (for accurate SVG text wrapping). */
|
|
2354
2354
|
measureText?: MeasureTextFn;
|
|
@@ -2758,7 +2758,7 @@ interface CompileOptions {
|
|
|
2758
2758
|
* layered, and sparkline charts.
|
|
2759
2759
|
*/
|
|
2760
2760
|
renderer?: 'auto' | 'svg' | 'canvas';
|
|
2761
|
-
/** Whether to show the
|
|
2761
|
+
/** Whether to show the OpenChart watermark. Defaults to true. */
|
|
2762
2762
|
watermark?: boolean;
|
|
2763
2763
|
/**
|
|
2764
2764
|
* Enable development-time diagnostics (WCAG contrast warnings via
|
|
@@ -4091,7 +4091,7 @@ interface Chrome {
|
|
|
4091
4091
|
/**
|
|
4092
4092
|
* Right-anchored brand block on the footer row. Visually balances the
|
|
4093
4093
|
* source/byline left-anchored text.
|
|
4094
|
-
* When set, suppresses the default `
|
|
4094
|
+
* When set, suppresses the default `OpenChart` watermark for this chart.
|
|
4095
4095
|
*/
|
|
4096
4096
|
brand?: string | ChromeText;
|
|
4097
4097
|
}
|
|
@@ -5168,7 +5168,7 @@ interface BaseChartSpec<TData extends DataRow = DataRow> {
|
|
|
5168
5168
|
/** Theme configuration overrides. */
|
|
5169
5169
|
theme?: ThemeConfig;
|
|
5170
5170
|
/**
|
|
5171
|
-
* Whether to show the
|
|
5171
|
+
* Whether to show the OpenChart watermark. Defaults to true; auto-hides
|
|
5172
5172
|
* when the container is under 200px tall (the cramped height class) unless
|
|
5173
5173
|
* explicitly set.
|
|
5174
5174
|
*/
|
|
@@ -5410,7 +5410,7 @@ interface TableSpec {
|
|
|
5410
5410
|
chrome?: Chrome;
|
|
5411
5411
|
/** Theme configuration overrides. */
|
|
5412
5412
|
theme?: ThemeConfig;
|
|
5413
|
-
/** Whether to show the
|
|
5413
|
+
/** Whether to show the OpenChart watermark. Defaults to true. */
|
|
5414
5414
|
watermark?: boolean;
|
|
5415
5415
|
/** Enable client-side search/filter. */
|
|
5416
5416
|
search?: boolean;
|
|
@@ -5620,7 +5620,7 @@ interface GraphSpec {
|
|
|
5620
5620
|
interactive?: boolean;
|
|
5621
5621
|
counts?: boolean;
|
|
5622
5622
|
};
|
|
5623
|
-
/** Whether to show the
|
|
5623
|
+
/** Whether to show the OpenChart watermark. Defaults to true. */
|
|
5624
5624
|
watermark?: boolean;
|
|
5625
5625
|
/**
|
|
5626
5626
|
* Render in two or three dimensions. Defaults to `2` (the Canvas renderer).
|
|
@@ -5743,7 +5743,7 @@ interface LayerSpec<TData extends DataRow = DataRow> {
|
|
|
5743
5743
|
responsive?: boolean | ResponsiveConfig;
|
|
5744
5744
|
/** Theme configuration overrides. */
|
|
5745
5745
|
theme?: ThemeConfig;
|
|
5746
|
-
/** Whether to show the
|
|
5746
|
+
/** Whether to show the OpenChart watermark. Defaults to true. */
|
|
5747
5747
|
watermark?: boolean;
|
|
5748
5748
|
/** Resolution strategy for shared scales/axes/legends. */
|
|
5749
5749
|
resolve?: ResolveConfig;
|
|
@@ -5833,7 +5833,7 @@ interface SankeySpec {
|
|
|
5833
5833
|
legend?: LegendConfig;
|
|
5834
5834
|
/** Theme configuration overrides. */
|
|
5835
5835
|
theme?: ThemeConfig;
|
|
5836
|
-
/** Whether to show the
|
|
5836
|
+
/** Whether to show the OpenChart watermark. Defaults to true. */
|
|
5837
5837
|
watermark?: boolean;
|
|
5838
5838
|
/**
|
|
5839
5839
|
* Motion. On by default: the entrance plays once the visualization scrolls
|
|
@@ -5918,7 +5918,7 @@ interface TileMapSpec {
|
|
|
5918
5918
|
legend?: LegendConfig;
|
|
5919
5919
|
/** Theme configuration overrides. */
|
|
5920
5920
|
theme?: ThemeConfig;
|
|
5921
|
-
/** Whether to show the
|
|
5921
|
+
/** Whether to show the OpenChart watermark. Defaults to true. */
|
|
5922
5922
|
watermark?: boolean;
|
|
5923
5923
|
/**
|
|
5924
5924
|
* Motion. On by default: the entrance plays once the visualization scrolls
|
|
@@ -6100,7 +6100,7 @@ interface GeoMapSpec {
|
|
|
6100
6100
|
legend?: LegendConfig;
|
|
6101
6101
|
/** Theme configuration overrides. */
|
|
6102
6102
|
theme?: ThemeConfig;
|
|
6103
|
-
/** Whether to show the
|
|
6103
|
+
/** Whether to show the OpenChart watermark. Defaults to true. */
|
|
6104
6104
|
watermark?: boolean;
|
|
6105
6105
|
/** Optional point/symbol layer rendered above choropleth features. */
|
|
6106
6106
|
points?: GeoMapPointsLayer;
|
|
@@ -6149,7 +6149,7 @@ interface BarListSpec {
|
|
|
6149
6149
|
chrome?: Chrome;
|
|
6150
6150
|
/** Theme configuration overrides. */
|
|
6151
6151
|
theme?: ThemeConfig;
|
|
6152
|
-
/** Whether to show the
|
|
6152
|
+
/** Whether to show the OpenChart watermark. Defaults to true. */
|
|
6153
6153
|
watermark?: boolean;
|
|
6154
6154
|
/**
|
|
6155
6155
|
* Motion. On by default: the entrance plays once the visualization scrolls
|
|
@@ -6306,7 +6306,7 @@ interface RaceSpec {
|
|
|
6306
6306
|
theme?: ThemeConfig;
|
|
6307
6307
|
/** Accessibility overrides. Omit to use generated metadata. */
|
|
6308
6308
|
a11y?: A11yConfig;
|
|
6309
|
-
/** Whether to show the
|
|
6309
|
+
/** Whether to show the OpenChart watermark. Defaults to true. */
|
|
6310
6310
|
watermark?: boolean;
|
|
6311
6311
|
/** Fixed render width in pixels. Defaults to container-driven sizing. */
|
|
6312
6312
|
width?: number;
|
|
@@ -7676,7 +7676,7 @@ declare function computeChrome(chrome: Chrome | undefined, theme: ResolvedTheme,
|
|
|
7676
7676
|
*/
|
|
7677
7677
|
declare function estimateTextWidth(text: string, fontSize: number, fontWeight?: number): number;
|
|
7678
7678
|
/**
|
|
7679
|
-
* Width reserved for the "
|
|
7679
|
+
* Width reserved for the "OpenChart" brand watermark in the bottom-right corner.
|
|
7680
7680
|
*/
|
|
7681
7681
|
declare const BRAND_RESERVE_WIDTH = 130;
|
|
7682
7682
|
/** Font size of the brand watermark (px). Shared between layout and renderer. */
|
package/dist/index.js
CHANGED
|
@@ -2726,10 +2726,10 @@ function measuredWatermark(theme, width, pad, y, measureText) {
|
|
|
2726
2726
|
lineHeight: 1.3
|
|
2727
2727
|
};
|
|
2728
2728
|
return {
|
|
2729
|
-
text: "
|
|
2729
|
+
text: "OpenChart",
|
|
2730
2730
|
x: width - pad,
|
|
2731
2731
|
y,
|
|
2732
|
-
maxWidth: measureText?.("
|
|
2732
|
+
maxWidth: measureText?.("OpenChart", BRAND_FONT_SIZE, 600).width ?? "OpenChart".length * estimateCharWidth(BRAND_FONT_SIZE, 600),
|
|
2733
2733
|
style
|
|
2734
2734
|
};
|
|
2735
2735
|
}
|
|
@@ -4359,14 +4359,14 @@ var ROLE_DEFS = /* @__PURE__ */ (() => [
|
|
|
4359
4359
|
{
|
|
4360
4360
|
name: "label",
|
|
4361
4361
|
scope: "chart",
|
|
4362
|
-
comment: "Data labels (bar values, line end labels) fade in place once their mark has\nlanded: when the bar at the label's --oc-mark-index reaches 0.
|
|
4362
|
+
comment: "Data labels (bar values, line end labels) fade in place once their mark has\nlanded: when the bar at the label's --oc-mark-index reaches 0.995, within a\npixel of its end, so a label never shows while its bar is still growing.\nLines share the bar's duration and curve, so the bar anchor stands in for\nthem. Labels never move during the entrance.",
|
|
4363
4363
|
selectors: [".oc-mark-label"],
|
|
4364
4364
|
emit: "shorthand",
|
|
4365
4365
|
keyframe: "oc-enter-fade-only",
|
|
4366
4366
|
timing: AUTHOR,
|
|
4367
4367
|
durationBasis: "phase",
|
|
4368
4368
|
duration: fixed(LABEL_FADE_MS),
|
|
4369
|
-
delay: { after: when("bar", 0.
|
|
4369
|
+
delay: { after: when("bar", 0.995), stagger: "mark" }
|
|
4370
4370
|
},
|
|
4371
4371
|
{
|
|
4372
4372
|
name: "arc-label",
|