@blueprint-chart/lib 2.13.0 → 2.15.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/dist/charts/scale-helpers.d.ts +3 -0
- package/dist/charts/sort-helpers.d.ts +15 -1
- package/dist/charts/stack-helpers.d.ts +5 -0
- package/dist/charts/types/dot-plot/rows.d.ts +5 -1
- package/dist/charts/types.d.ts +24 -0
- package/dist/enums.d.ts +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +385 -384
- package/dist/lib/lib.iife.js +16 -16
- package/dist/node-backend/index.js +2751 -2549
- package/dist/{render-bpc-Df2pX315.js → render-bpc-CPj5h-p4.js} +2554 -2352
- package/dist/runtime.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
import { SortDirection } from '../enums';
|
|
1
|
+
import { SortDirection, SortMode } from '../enums';
|
|
2
2
|
export declare function sortByValue<T>(items: readonly T[], value: (item: T, index: number) => number, direction: SortDirection | undefined): T[];
|
|
3
3
|
export declare function labelTotal(series: readonly {
|
|
4
4
|
values: number[];
|
|
5
5
|
}[], index: number): number;
|
|
6
|
+
interface CategorySortOptions {
|
|
7
|
+
sortMode?: SortMode;
|
|
8
|
+
sortSeries?: string;
|
|
9
|
+
sortReverse?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function sortCategories(labels: readonly string[], series: readonly {
|
|
12
|
+
name: string;
|
|
13
|
+
values: number[];
|
|
14
|
+
}[], { sortMode, sortSeries, sortReverse }: CategorySortOptions): readonly string[];
|
|
15
|
+
export declare function withinGroupSlots(labels: readonly string[], series: readonly {
|
|
16
|
+
name: string;
|
|
17
|
+
values: number[];
|
|
18
|
+
}[]): (label: string, seriesName: string) => string;
|
|
19
|
+
export {};
|
|
@@ -15,3 +15,8 @@ export declare function computeStack(data: ChartData): d3.Series<Record<string,
|
|
|
15
15
|
* Each category's magnitudes sum to 100, negatives below the baseline.
|
|
16
16
|
*/
|
|
17
17
|
export declare function computeStack100(data: ChartData): d3.Series<Record<string, number>, string>[];
|
|
18
|
+
export declare function restackWithinGroups<T extends {
|
|
19
|
+
label: string;
|
|
20
|
+
y0: number;
|
|
21
|
+
y1: number;
|
|
22
|
+
}>(segments: readonly T[]): T[];
|
|
@@ -16,5 +16,9 @@ export declare function buildDotPlotRows(data: ChartData, resolved: ResolvedDotP
|
|
|
16
16
|
rows: DotPlotRow[];
|
|
17
17
|
dropped: DroppedRow[];
|
|
18
18
|
};
|
|
19
|
-
export declare function
|
|
19
|
+
export declare function percentChange(row: DotPlotRow): number;
|
|
20
|
+
export declare function sortDotPlotRows(rows: DotPlotRow[], { sortMode, sortReverse }: {
|
|
21
|
+
sortMode?: SortMode;
|
|
22
|
+
sortReverse?: boolean;
|
|
23
|
+
}, mode: DotPlotMode): DotPlotRow[];
|
|
20
24
|
export {};
|
package/dist/charts/types.d.ts
CHANGED
|
@@ -144,6 +144,7 @@ export interface SeriesOverride {
|
|
|
144
144
|
symbolOpacity?: number;
|
|
145
145
|
opacity?: number;
|
|
146
146
|
hidden?: boolean;
|
|
147
|
+
connectGaps?: boolean;
|
|
147
148
|
}
|
|
148
149
|
export interface ChartOptions {
|
|
149
150
|
frame?: FrameOptions | null;
|
|
@@ -151,6 +152,8 @@ export interface ChartOptions {
|
|
|
151
152
|
horizontalAxis?: AxisOptions;
|
|
152
153
|
sort?: SortDirection;
|
|
153
154
|
sortMode?: SortMode;
|
|
155
|
+
sortSeries?: string;
|
|
156
|
+
sortReverse?: boolean;
|
|
154
157
|
colorizes?: ColorizeConfig[];
|
|
155
158
|
highlights?: HighlightConfig[];
|
|
156
159
|
colors?: string[];
|
|
@@ -162,6 +165,7 @@ export interface ChartOptions {
|
|
|
162
165
|
directLabelAnchor?: Anchor;
|
|
163
166
|
areaFill?: boolean;
|
|
164
167
|
areaFillOpacity?: number;
|
|
168
|
+
areaFillBaseline?: 'bottom' | 'zero';
|
|
165
169
|
areaFills?: AreaFillConfig[];
|
|
166
170
|
stacked?: boolean;
|
|
167
171
|
stackPercent?: boolean;
|
|
@@ -181,6 +185,10 @@ export interface ChartOptions {
|
|
|
181
185
|
seriesOverrides?: SeriesOverride[];
|
|
182
186
|
displayAsPercentage?: boolean;
|
|
183
187
|
showTotal?: boolean;
|
|
188
|
+
centerLabel?: string;
|
|
189
|
+
centerSlice?: string;
|
|
190
|
+
centerText?: string;
|
|
191
|
+
totalLabel?: string;
|
|
184
192
|
showLabels?: boolean;
|
|
185
193
|
showValues?: boolean;
|
|
186
194
|
sliceMax?: number;
|
|
@@ -193,8 +201,10 @@ export interface ChartOptions {
|
|
|
193
201
|
barGap?: number;
|
|
194
202
|
connectedColumns?: boolean;
|
|
195
203
|
connectionsOpacity?: number;
|
|
204
|
+
negativeColor?: string;
|
|
196
205
|
stackMode?: StackMode;
|
|
197
206
|
edgePadding?: boolean;
|
|
207
|
+
connectGaps?: boolean;
|
|
198
208
|
waterfall?: boolean;
|
|
199
209
|
waterfallTotal?: boolean;
|
|
200
210
|
sharedScale?: boolean;
|
|
@@ -208,6 +218,7 @@ export interface ChartOptions {
|
|
|
208
218
|
low?: string;
|
|
209
219
|
high?: string;
|
|
210
220
|
arrows?: ArrowDirection;
|
|
221
|
+
dotLabels?: 'both' | 'start' | 'end' | 'difference' | 'change';
|
|
211
222
|
}
|
|
212
223
|
export type ChartRenderer = (container: HTMLElement, data: ChartData, options: ChartOptions, transition?: boolean) => void;
|
|
213
224
|
export interface ChartOptionDef {
|
|
@@ -250,10 +261,12 @@ export interface ChartTypeOptions {
|
|
|
250
261
|
verticalLabelPosition: string;
|
|
251
262
|
verticalRangeMin: string;
|
|
252
263
|
verticalRangeMax: string;
|
|
264
|
+
verticalTickValues: string;
|
|
253
265
|
horizontalLabelPosition: string;
|
|
254
266
|
horizontalLabelRotation: string;
|
|
255
267
|
horizontalRangeMin: string;
|
|
256
268
|
horizontalRangeMax: string;
|
|
269
|
+
horizontalTickValues: string;
|
|
257
270
|
valueLabels: boolean | 'percent';
|
|
258
271
|
valueLabelPosition: string;
|
|
259
272
|
valueLabelPoints: string;
|
|
@@ -271,6 +284,10 @@ export interface ChartTypeOptions {
|
|
|
271
284
|
lineSymbolOpacity: string;
|
|
272
285
|
displayAsPercentage: boolean;
|
|
273
286
|
showTotal: boolean;
|
|
287
|
+
centerLabel: string;
|
|
288
|
+
centerSlice: string;
|
|
289
|
+
centerText: string;
|
|
290
|
+
totalLabel: string;
|
|
274
291
|
showLabels: boolean;
|
|
275
292
|
showValues: boolean;
|
|
276
293
|
swapLabelValue: boolean;
|
|
@@ -279,18 +296,24 @@ export interface ChartTypeOptions {
|
|
|
279
296
|
autoContrast: boolean;
|
|
280
297
|
allowDarkMode: boolean;
|
|
281
298
|
sortMode: SortMode;
|
|
299
|
+
sortSeries: string;
|
|
300
|
+
sortReverse: boolean;
|
|
282
301
|
barBackground: boolean;
|
|
283
302
|
barSeparators: boolean;
|
|
284
303
|
barGap: string;
|
|
285
304
|
connectedColumns: boolean;
|
|
286
305
|
connectionsOpacity: string;
|
|
306
|
+
negativeColor: string;
|
|
287
307
|
stackMode: string;
|
|
288
308
|
stacked: boolean;
|
|
289
309
|
stackPercent: boolean;
|
|
290
310
|
areaSortMode: string;
|
|
291
311
|
areaLines: boolean;
|
|
312
|
+
areaFill: boolean;
|
|
292
313
|
areaFillOpacity: string;
|
|
314
|
+
areaFillBaseline: string;
|
|
293
315
|
edgePadding: boolean;
|
|
316
|
+
connectGaps: boolean;
|
|
294
317
|
waterfall: boolean;
|
|
295
318
|
waterfallTotal: boolean;
|
|
296
319
|
sharedScale: boolean;
|
|
@@ -304,5 +327,6 @@ export interface ChartTypeOptions {
|
|
|
304
327
|
low: string;
|
|
305
328
|
high: string;
|
|
306
329
|
arrows: ArrowDirection;
|
|
330
|
+
dotLabels: string;
|
|
307
331
|
}
|
|
308
332
|
export type ChartTypeOptionKey = keyof ChartTypeOptions;
|
package/dist/enums.d.ts
CHANGED
|
@@ -149,9 +149,11 @@ export declare enum DotStyle {
|
|
|
149
149
|
export declare enum SortMode {
|
|
150
150
|
Total = "total",
|
|
151
151
|
WithinGroups = "within-groups",
|
|
152
|
+
Series = "series",
|
|
152
153
|
None = "none",
|
|
153
154
|
Value = "value",
|
|
154
|
-
Gap = "gap"
|
|
155
|
+
Gap = "gap",
|
|
156
|
+
Change = "change"
|
|
155
157
|
}
|
|
156
158
|
export declare enum LegendPosition {
|
|
157
159
|
Top = "top",
|
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export { shapeOf } from './recommendations/shape';
|
|
|
19
19
|
export type { ChartRecommendation, RecommendationFitness, ColumnType, Intent, ShapeSignature } from './recommendations/types';
|
|
20
20
|
export { getChartTypeDefaults, resolveChartTypeOptions } from './charts/resolve';
|
|
21
21
|
export { resolveBarGapPadding, DEFAULT_BAR_GAP } from './charts/scale-helpers';
|
|
22
|
-
export { resolvePalette, listPalettes } from './charts/palettes';
|
|
22
|
+
export { DEFAULT_COLORS, resolvePalette, listPalettes } from './charts/palettes';
|
|
23
23
|
export type { PaletteEntry } from './charts/palettes';
|
|
24
24
|
export { listThemes } from './charts/themes';
|
|
25
25
|
export type { ThemeEntry } from './charts/themes';
|