@object-ui/plugin-charts 7.0.0 → 7.1.0
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/CHANGELOG.md +50 -0
- package/dist/AdvancedChartImpl.d.ts +23 -1
- package/dist/ChartRenderer.d.ts +8 -0
- package/dist/index.js +516 -433
- package/dist/index.umd.cjs +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# @object-ui/plugin-charts
|
|
2
2
|
|
|
3
|
+
## 7.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 677f7ed: feat(charts,dashboard): data-screen customization primitives
|
|
8
|
+
|
|
9
|
+
- object-metric `variant:'bare'` — big tinted number + label, no card chrome
|
|
10
|
+
(data-screen KPIs that stay data-bound).
|
|
11
|
+
- object-chart `colors` prop overrides the theme `--chart-1..n` palette so a
|
|
12
|
+
page/dashboard can brand its charts; compact metric formatting (`'0.0a'` →
|
|
13
|
+
"1.1M").
|
|
14
|
+
- ObjectChartSchema.chartType widened to donut/horizontal-bar/column.
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 08c47da: feat(dashboard): dataset chart widgets paint select/lookup dimensions in their option colors
|
|
19
|
+
|
|
20
|
+
A dashboard `DatasetWidget` chart grouped by a select/lookup dimension (e.g.
|
|
21
|
+
project `health`) painted its categories from the generic `--chart-1..5`
|
|
22
|
+
palette — the same gap the chart view (`object-chart`) had before #1932. It now
|
|
23
|
+
resolves the dimension field's option colors (using the dataset's base `object`
|
|
24
|
+
- dimension→field map the query already returns) and threads them to the
|
|
25
|
+
renderer as a per-category `categoryColors` map, so health green/red/yellow
|
|
26
|
+
paints semantically.
|
|
27
|
+
|
|
28
|
+
The value/label→color resolution is extracted into a shared `buildOptionColorMap`
|
|
29
|
+
(`@object-ui/core`) now used by both `DatasetWidget` and `ObjectChart`.
|
|
30
|
+
|
|
31
|
+
- 93cf2b1: fix(charts): use field option colors for categorical chart dimensions
|
|
32
|
+
|
|
33
|
+
An `object-chart` grouped by a select/lookup field (e.g. project `health`)
|
|
34
|
+
painted its categories from the generic `--chart-1..5` palette, so a "Red"
|
|
35
|
+
health slice rendered teal and "Green" rendered blue. The chart now resolves
|
|
36
|
+
the category dimension's option colors — both the `objectName` + `groupBy`
|
|
37
|
+
path and the dataset path (via the dataset's `object` + dimension `field`) —
|
|
38
|
+
and threads them to the renderer as a per-category `categoryColors` map. That
|
|
39
|
+
map wins over the positional palette and falls back to it for categories
|
|
40
|
+
without an option color, so pie/donut slices and bar cells render in their
|
|
41
|
+
semantic colors.
|
|
42
|
+
|
|
43
|
+
- Updated dependencies [677f7ed]
|
|
44
|
+
- Updated dependencies [08c47da]
|
|
45
|
+
- Updated dependencies [a71be60]
|
|
46
|
+
- Updated dependencies [cb03bc3]
|
|
47
|
+
- @object-ui/types@7.1.0
|
|
48
|
+
- @object-ui/core@7.1.0
|
|
49
|
+
- @object-ui/react@7.1.0
|
|
50
|
+
- @object-ui/components@7.1.0
|
|
51
|
+
- @object-ui/i18n@7.1.0
|
|
52
|
+
|
|
3
53
|
## 7.0.0
|
|
4
54
|
|
|
5
55
|
### Patch Changes
|
|
@@ -21,6 +21,18 @@ export interface AdvancedChartImplProps {
|
|
|
21
21
|
label?: string;
|
|
22
22
|
}>;
|
|
23
23
|
className?: string;
|
|
24
|
+
/** Categorical/series colour palette. Overrides the theme's `--chart-1..n`
|
|
25
|
+
* defaults so a page/dashboard can brand its charts (data-screens). */
|
|
26
|
+
colors?: string[];
|
|
27
|
+
/**
|
|
28
|
+
* Per-category colour map keyed by the category value OR its display label
|
|
29
|
+
* (e.g. `{ green: '#10B981', Green: '#10B981' }`). When the chart's category
|
|
30
|
+
* dimension is a select/lookup field, ObjectChart resolves the field's option
|
|
31
|
+
* colours into this map so a "Red" health slice paints red instead of taking
|
|
32
|
+
* the next positional palette slot. A category found here WINS over `colors`;
|
|
33
|
+
* categories absent here fall back to the positional palette, then the theme.
|
|
34
|
+
*/
|
|
35
|
+
categoryColors?: Record<string, string>;
|
|
24
36
|
/**
|
|
25
37
|
* Optional drill-down click handler. Fires when a chart segment is clicked
|
|
26
38
|
* with `{ category, series, value }`. Wired for bar/horizontal-bar/line/
|
|
@@ -31,9 +43,19 @@ export interface AdvancedChartImplProps {
|
|
|
31
43
|
series?: string;
|
|
32
44
|
value?: number;
|
|
33
45
|
}) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Disable Recharts' entrance animation when `false`. Animations drive the
|
|
48
|
+
* reveal via `requestAnimationFrame`, which browsers throttle/pause in
|
|
49
|
+
* hidden/background tabs — so a chart rendered off-screen (analytics export,
|
|
50
|
+
* a report opened in an inactive tab, headless capture) can freeze at frame 0
|
|
51
|
+
* and look empty (esp. pie/donut: sectors at angle 0 = no ring, legend only).
|
|
52
|
+
* Reports pass `false` for a deterministic, instant, export-safe render.
|
|
53
|
+
* Omitted/true preserves the animated default everywhere else (dashboards).
|
|
54
|
+
*/
|
|
55
|
+
isAnimationActive?: boolean;
|
|
34
56
|
}
|
|
35
57
|
/**
|
|
36
58
|
* AdvancedChartImpl - The heavy implementation that imports Recharts with full features
|
|
37
59
|
* This component is lazy-loaded to avoid including Recharts in the initial bundle
|
|
38
60
|
*/
|
|
39
|
-
export default function AdvancedChartImpl({ chartType: rawChartType, data: rawData, config, xAxisKey, series, className, onChartClick, }: AdvancedChartImplProps): React.JSX.Element;
|
|
61
|
+
export default function AdvancedChartImpl({ chartType: rawChartType, data: rawData, config, xAxisKey, series, className, colors, categoryColors, onChartClick, isAnimationActive, }: AdvancedChartImplProps): React.JSX.Element;
|
package/dist/ChartRenderer.d.ts
CHANGED
|
@@ -32,6 +32,14 @@ export interface ChartRendererProps {
|
|
|
32
32
|
dashArray?: string;
|
|
33
33
|
chartType?: 'bar' | 'line' | 'area';
|
|
34
34
|
}>;
|
|
35
|
+
colors?: string[];
|
|
36
|
+
/** Per-category colour map (value/label → colour). Wins over `colors` per
|
|
37
|
+
* category; see AdvancedChartImpl. Set by ObjectChart from select/lookup
|
|
38
|
+
* dimension option colours and/or an explicit author map. */
|
|
39
|
+
categoryColors?: Record<string, string>;
|
|
40
|
+
/** Pass `false` for a deterministic, export-safe render with no entrance
|
|
41
|
+
* animation (see AdvancedChartImpl). Omitted → animated default. */
|
|
42
|
+
isAnimationActive?: boolean;
|
|
35
43
|
};
|
|
36
44
|
/** Drill-down click handler — wired by ObjectChart when drillDown is enabled. */
|
|
37
45
|
onChartClick?: (event: {
|