@blueprint-chart/lib 0.1.15 → 0.1.18
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/charts/axis/axis-service.d.ts +5 -0
- package/dist/charts/clip-path-helper.d.ts +7 -0
- package/dist/charts/contrast.d.ts +4 -1
- package/dist/charts/plugins/proximity.d.ts +8 -0
- package/dist/charts/scale-helpers.d.ts +2 -1
- package/dist/charts/types/pie/pie.d.ts +8 -0
- package/dist/charts/types.d.ts +0 -1
- package/dist/dsl/types.d.ts +3 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3576 -3155
- package/dist/lib/lib.iife.js +4 -3
- package/dist/recommendations/recommend.d.ts +9 -0
- package/dist/render/ast-to-definition.d.ts +2 -0
- package/dist/render/cross-type-fade.d.ts +9 -0
- package/dist/render/resolve-scene.d.ts +2 -0
- package/dist/render/types.d.ts +7 -0
- package/dist/runtime/chart-css.d.ts +1 -1
- package/dist/runtime/runtime.d.ts +1 -0
- package/dist/runtime/scenes.d.ts +1 -1
- package/dist/transitions/feature-join.d.ts +13 -0
- package/dist/transitions/index.d.ts +7 -0
- package/dist/transitions/role-matcher.d.ts +42 -0
- package/dist/transitions/scene-transition.d.ts +78 -0
- package/dist/transitions/snapshot.d.ts +16 -0
- package/dist/transitions/types.d.ts +44 -0
- package/package.json +1 -1
- package/src/charts/chart.scss +26 -1
- package/dist/dsl/lexer.d.ts +0 -8
|
@@ -27,6 +27,11 @@ export declare class AxisService {
|
|
|
27
27
|
/**
|
|
28
28
|
* Remove axis groups from DOM before replaceChildren().
|
|
29
29
|
* The groups are kept in memory for reattachment.
|
|
30
|
+
*
|
|
31
|
+
* Interrupts any pending D3 transitions on the axis groups (and their
|
|
32
|
+
* descendants) before detaching so tween callbacks don't continue writing
|
|
33
|
+
* attributes to nodes that have just been removed from the DOM — which would
|
|
34
|
+
* otherwise throw in jsdom (no SVG baseVal) and leak work in real browsers.
|
|
30
35
|
*/
|
|
31
36
|
detach(): void;
|
|
32
37
|
/**
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns '#fff' or '#333' — whichever has better contrast against `bg`.
|
|
3
|
+
* Falls back to '#333' (readable on the default light background) when `bg`
|
|
4
|
+
* isn't a valid color string.
|
|
3
5
|
*/
|
|
4
6
|
export declare function contrastTextColor(bg: string): string;
|
|
5
7
|
/**
|
|
6
8
|
* Compute WCAG 2.1 contrast ratio between two colors.
|
|
7
|
-
* Returns a value between 1 and 21
|
|
9
|
+
* Returns a value between 1 and 21, or 1 (no contrast) when either input
|
|
10
|
+
* isn't a valid color string.
|
|
8
11
|
*/
|
|
9
12
|
export declare function wcagContrastRatio(fg: string, bg: string): number;
|
|
10
13
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function disposeProximityFor(container: Element): void;
|
|
1
2
|
export interface ProximityPoint {
|
|
2
3
|
cx: number;
|
|
3
4
|
cy: number;
|
|
@@ -17,6 +18,13 @@ export interface ProximityOptions {
|
|
|
17
18
|
crosshairColor?: string;
|
|
18
19
|
format?: (point: ProximityPoint) => string;
|
|
19
20
|
numberFormat?: string;
|
|
21
|
+
/**
|
|
22
|
+
* When provided, the returned cleanup function is registered in a per-container
|
|
23
|
+
* registry. Subsequent renders against the same container should call
|
|
24
|
+
* `disposeProximityFor(container)` to tear down the prior interaction before
|
|
25
|
+
* a new one is created, preventing leaked tooltips and listeners.
|
|
26
|
+
*/
|
|
27
|
+
container?: Element;
|
|
20
28
|
}
|
|
21
29
|
export declare function makeDefaultFormat(numberFormat?: string): (p: ProximityPoint) => string;
|
|
22
30
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ScaleType } from '../enums';
|
|
1
2
|
/**
|
|
2
3
|
* Filter chart labels (and corresponding data) by a horizontal axis range.
|
|
3
4
|
* Returns the indices of labels that fall within [min, max].
|
|
@@ -16,4 +17,4 @@ export declare function resolveBarGapPadding(barGap?: number): number;
|
|
|
16
17
|
export declare function computeLinearDomain(values: number[], range?: {
|
|
17
18
|
min?: number;
|
|
18
19
|
max?: number;
|
|
19
|
-
}): [number, number];
|
|
20
|
+
}, scaleType?: ScaleType): [number, number];
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { ChartData, ChartOptions } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Render a pie chart.
|
|
4
|
+
*
|
|
5
|
+
* Pie is a thin wrapper around the shared `renderArc` (innerRadiusRatio = 0).
|
|
6
|
+
* Slices are joined via the SceneTransition orchestrator (`featureJoin` with
|
|
7
|
+
* role `'mark-per-category'`) inside `renderArc` itself; this file holds no
|
|
8
|
+
* rendering logic of its own.
|
|
9
|
+
*/
|
|
2
10
|
export declare function render(container: HTMLElement, data: ChartData, options?: ChartOptions, transition?: boolean): void;
|
package/dist/charts/types.d.ts
CHANGED
package/dist/dsl/types.d.ts
CHANGED
|
@@ -14,10 +14,12 @@ export interface ColorizeNode {
|
|
|
14
14
|
type: DslNodeType.Colorize;
|
|
15
15
|
target: string;
|
|
16
16
|
properties: PropertyNode[];
|
|
17
|
+
fromHighlight?: boolean;
|
|
17
18
|
}
|
|
18
19
|
export interface HighlightNode {
|
|
19
20
|
type: DslNodeType.Highlight;
|
|
20
21
|
target: string;
|
|
22
|
+
properties: PropertyNode[];
|
|
21
23
|
}
|
|
22
24
|
export interface AreaFillNode {
|
|
23
25
|
type: DslNodeType.AreaFill;
|
|
@@ -82,6 +84,7 @@ export interface ChartNode {
|
|
|
82
84
|
highlights: HighlightNode[];
|
|
83
85
|
areaFills: AreaFillNode[];
|
|
84
86
|
annotations: AnnotationNode[];
|
|
87
|
+
annotationVisibility: AnnotationVisibilityNode[];
|
|
85
88
|
series: SeriesNode[];
|
|
86
89
|
scenes: SceneNode[];
|
|
87
90
|
transforms: TransformNode[];
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export { renderHorizontalAxis } from './charts/axis/horizontal-axis';
|
|
|
9
9
|
export { renderLegend } from './charts/legend/legend';
|
|
10
10
|
export { registerChart, getChart, getChartOptions, listCharts } from './charts/registry';
|
|
11
11
|
export { parseData, buildChartOptions } from './charts/chart-helpers';
|
|
12
|
+
export { recommendCharts } from './recommendations/recommend';
|
|
13
|
+
export type { ChartRecommendation, RecommendationFitness, ColumnType } from './recommendations/recommend';
|
|
12
14
|
export { getChartTypeDefaults, resolveChartTypeOptions } from './charts/resolve';
|
|
13
15
|
export { resolveBarGapPadding, DEFAULT_BAR_GAP } from './charts/scale-helpers';
|
|
14
16
|
export { resolvePalette, listPalettes } from './charts/palettes';
|
|
@@ -27,3 +29,5 @@ export { samples } from './samples';
|
|
|
27
29
|
export type { ChartSample } from './samples';
|
|
28
30
|
export { renderBpc, renderChart, astToDefinition, resolveScene } from './render';
|
|
29
31
|
export type { ChartDefinition, RenderOptions, ResolvedChartState } from './render';
|
|
32
|
+
export { SceneTransition, getSceneTransition, featureJoin, snapshotLiveAttrs, BC_TRANSITION_NAME, } from './transitions';
|
|
33
|
+
export type { CommitOptions, TransitionMode, SceneTransitionState, FeatureRole, FeatureJoinConfig, AttrMap, AttrValue, } from './transitions';
|