@unovis/ts 1.2.2-beta.4 → 1.2.2-beta.5
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.
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { XYComponentConfigInterface, XYComponentConfig } from "../../core/xy-component/config";
|
|
2
2
|
import { Tooltip } from "../tooltip";
|
|
3
|
-
import { NumericAccessor } from "../../types/accessor";
|
|
3
|
+
import { NumericAccessor, ColorAccessor } from "../../types/accessor";
|
|
4
4
|
import { ContinuousScale } from "../../types/scale";
|
|
5
5
|
import { CrosshairCircle } from './types';
|
|
6
6
|
export interface CrosshairConfigInterface<Datum> extends Partial<XYComponentConfigInterface<Datum>> {
|
|
7
|
+
/** Optional accessor function for getting the values along the X axis. Default: `undefined` */
|
|
8
|
+
x?: NumericAccessor<Datum>;
|
|
9
|
+
/** Optional single of multiple accessor functions for getting the values along the Y axis. Default: `undefined` */
|
|
10
|
+
y?: NumericAccessor<Datum> | NumericAccessor<Datum>[];
|
|
11
|
+
/** Optional color array or color accessor function for crosshair circles. Default: `d => d.color` */
|
|
12
|
+
color?: ColorAccessor<Datum> | ColorAccessor<Datum[]>;
|
|
7
13
|
/** Separate array of accessors for stacked components (eg StackedBar, Area). Default: `undefined` */
|
|
8
14
|
yStacked?: NumericAccessor<Datum>[];
|
|
9
15
|
/** Baseline accessor function for stacked values, useful with stacked areas. Default: `null` */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/crosshair/config.ts"],"sourcesContent":["import { XYComponentConfigInterface, XYComponentConfig } from 'core/xy-component/config'\nimport { Tooltip } from 'components/tooltip'\n\n// Types\nimport { NumericAccessor } from 'types/accessor'\nimport { ContinuousScale } from 'types/scale'\nimport { CrosshairCircle } from './types'\n\n// We extend partial XY config interface because x and y properties are optional for Crosshair\nexport interface CrosshairConfigInterface<Datum> extends Partial<XYComponentConfigInterface<Datum>> {\n /** Separate array of accessors for stacked components (eg StackedBar, Area). Default: `undefined` */\n yStacked?: NumericAccessor<Datum>[];\n /** Baseline accessor function for stacked values, useful with stacked areas. Default: `null` */\n baseline?: NumericAccessor<Datum>;\n /** An instance of the Tooltip component to be used with Crosshair. Default: `undefined` */\n tooltip?: Tooltip | undefined;\n /** Tooltip template accessor. The function is supposed to return either a valid HTML string or an HTMLElement. Default: `d => ''` */\n template?: (data: Datum, x: number | Date) => string | HTMLElement;\n /** Hide Crosshair when the corresponding element is far from mouse pointer. Default: `true` */\n hideWhenFarFromPointer?: boolean;\n /** Distance in pixels to check in the hideWhenFarFromPointer condition. Default: `100` */\n hideWhenFarFromPointerDistance?: number;\n /** Snap to the nearest data point.\n * If disabled, the tooltip template will receive only the horizontal position of the crosshair and you'll be responsible\n * for getting the underlying data records and crosshair circles (see the `getCircles` configuration option).\n * Default: `true`\n */\n snapToData?: boolean;\n /** Custom function for setting up the crosshair circles, usually needed when `snapToData` is set to `false`.\n * The function receives the horizontal position of the crosshair (in the data space, not in pixels), the data array\n * and the `yScale` instance to help you calculate the correct vertical position of the circles.\n * It has to return an array of the CrosshairCircle objects: `{ y: number; color: string; opacity?: number }[]`.\n * Default: `undefined`\n */\n getCircles?: (x: number, data: Datum[], yScale: ContinuousScale) => CrosshairCircle[];\n}\n\nexport class CrosshairConfig<Datum> extends XYComponentConfig<Datum> implements CrosshairConfigInterface<Datum> {\n yStacked = undefined\n baseline = null\n duration = 100\n tooltip: Tooltip = undefined\n template: ((data: Datum, x: number | Date) => string | HTMLElement) = (d: Datum): string => ''\n hideWhenFarFromPointer = true\n hideWhenFarFromPointerDistance = 100\n snapToData = true\n getCircles = undefined\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/crosshair/config.ts"],"sourcesContent":["import { XYComponentConfigInterface, XYComponentConfig } from 'core/xy-component/config'\nimport { Tooltip } from 'components/tooltip'\n\n// Types\nimport { NumericAccessor, ColorAccessor } from 'types/accessor'\nimport { ContinuousScale } from 'types/scale'\nimport { CrosshairCircle } from './types'\n\n// We extend partial XY config interface because x and y properties are optional for Crosshair\nexport interface CrosshairConfigInterface<Datum> extends Partial<XYComponentConfigInterface<Datum>> {\n /** Optional accessor function for getting the values along the X axis. Default: `undefined` */\n x?: NumericAccessor<Datum>;\n /** Optional single of multiple accessor functions for getting the values along the Y axis. Default: `undefined` */\n y?: NumericAccessor<Datum> | NumericAccessor<Datum>[];\n /** Optional color array or color accessor function for crosshair circles. Default: `d => d.color` */\n color?: ColorAccessor<Datum> | ColorAccessor<Datum[]>\n /** Separate array of accessors for stacked components (eg StackedBar, Area). Default: `undefined` */\n yStacked?: NumericAccessor<Datum>[];\n /** Baseline accessor function for stacked values, useful with stacked areas. Default: `null` */\n baseline?: NumericAccessor<Datum>;\n /** An instance of the Tooltip component to be used with Crosshair. Default: `undefined` */\n tooltip?: Tooltip | undefined;\n /** Tooltip template accessor. The function is supposed to return either a valid HTML string or an HTMLElement. Default: `d => ''` */\n template?: (data: Datum, x: number | Date) => string | HTMLElement;\n /** Hide Crosshair when the corresponding element is far from mouse pointer. Default: `true` */\n hideWhenFarFromPointer?: boolean;\n /** Distance in pixels to check in the hideWhenFarFromPointer condition. Default: `100` */\n hideWhenFarFromPointerDistance?: number;\n /** Snap to the nearest data point.\n * If disabled, the tooltip template will receive only the horizontal position of the crosshair and you'll be responsible\n * for getting the underlying data records and crosshair circles (see the `getCircles` configuration option).\n * Default: `true`\n */\n snapToData?: boolean;\n /** Custom function for setting up the crosshair circles, usually needed when `snapToData` is set to `false`.\n * The function receives the horizontal position of the crosshair (in the data space, not in pixels), the data array\n * and the `yScale` instance to help you calculate the correct vertical position of the circles.\n * It has to return an array of the CrosshairCircle objects: `{ y: number; color: string; opacity?: number }[]`.\n * Default: `undefined`\n */\n getCircles?: (x: number, data: Datum[], yScale: ContinuousScale) => CrosshairCircle[];\n}\n\nexport class CrosshairConfig<Datum> extends XYComponentConfig<Datum> implements CrosshairConfigInterface<Datum> {\n yStacked = undefined\n baseline = null\n duration = 100\n tooltip: Tooltip = undefined\n template: ((data: Datum, x: number | Date) => string | HTMLElement) = (d: Datum): string => ''\n hideWhenFarFromPointer = true\n hideWhenFarFromPointerDistance = 100\n snapToData = true\n getCircles = undefined\n}\n"],"names":[],"mappings":";;AA2CM,MAAO,eAAuB,SAAQ,iBAAwB,CAAA;AAApE,IAAA,WAAA,GAAA;;QACE,IAAQ,CAAA,QAAA,GAAG,SAAS,CAAA;QACpB,IAAQ,CAAA,QAAA,GAAG,IAAI,CAAA;QACf,IAAQ,CAAA,QAAA,GAAG,GAAG,CAAA;QACd,IAAO,CAAA,OAAA,GAAY,SAAS,CAAA;AAC5B,QAAA,IAAA,CAAA,QAAQ,GAA8D,CAAC,CAAQ,KAAa,EAAE,CAAA;QAC9F,IAAsB,CAAA,sBAAA,GAAG,IAAI,CAAA;QAC7B,IAA8B,CAAA,8BAAA,GAAG,GAAG,CAAA;QACpC,IAAU,CAAA,UAAA,GAAG,IAAI,CAAA;QACjB,IAAU,CAAA,UAAA,GAAG,SAAS,CAAA;KACvB;AAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unovis/ts",
|
|
3
3
|
"description": "Modular data visualization framework for React, Angular, Svelte, and vanilla TypeScript or JavaScript",
|
|
4
|
-
"version": "1.2.2-beta.
|
|
4
|
+
"version": "1.2.2-beta.5",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/f5/unovis.git",
|