@unovis/ts 1.4.2-alpha.0 → 1.4.2-alpha.1

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.
@@ -6,7 +6,7 @@ import { Arrangement } from '../../types/position.js';
6
6
  import { BrushDefaultConfig } from './config.js';
7
7
  import { BrushDirection } from './types.js';
8
8
  import * as style from './style.js';
9
- import { brush, unselected, handleLine } from './style.js';
9
+ import { unselected, brush, handleLine } from './style.js';
10
10
 
11
11
  class Brush extends XYComponentCore {
12
12
  constructor(config) {
@@ -22,15 +22,15 @@ class Brush extends XYComponentCore {
22
22
  this._firstRender = true;
23
23
  if (config)
24
24
  this.setConfig(config);
25
- this.brush = this.g
26
- .append('g')
27
- .attr('class', brush);
28
25
  const directions = [{ type: BrushDirection.West }, { type: BrushDirection.East }];
29
26
  this.unselectedRange = this.g
30
27
  .selectAll(`.${unselected}`)
31
28
  .data(directions)
32
29
  .enter().append('rect')
33
30
  .attr('class', unselected);
31
+ this.brush = this.g
32
+ .append('g')
33
+ .attr('class', brush);
34
34
  this.handleLines = this.g
35
35
  .selectAll(`.${handleLine}`)
36
36
  .data(directions)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/brush/index.ts"],"sourcesContent":["import { BrushBehavior, brushX, D3BrushEvent } from 'd3-brush'\nimport { Selection } from 'd3-selection'\n\n// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Utils\nimport { isNumber, clamp } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\n\n// Types\nimport { Arrangement } from 'types/position'\n\n// Config\nimport { BrushDefaultConfig, BrushConfigInterface } from './config'\n\n// Local Types\nimport { BrushDirection, BrushHandleType } from './types'\n\n// Styles\nimport * as s from './style'\n\nexport class Brush<Datum> extends XYComponentCore<Datum, BrushConfigInterface<Datum>> {\n static selectors = s\n protected _defaultConfig = BrushDefaultConfig as BrushConfigInterface<Datum>\n clippable = false // Don't apply clipping path to this component. See XYContainer\n public config: BrushConfigInterface<Datum> = this._defaultConfig\n brush: Selection<SVGGElement, unknown, SVGGElement, unknown>\n unselectedRange: Selection<SVGRectElement, BrushHandleType, SVGGElement, unknown>\n handleLines: Selection<SVGLineElement, BrushHandleType, SVGGElement, unknown>\n brushBehaviour: BrushBehavior<unknown> = brushX()\n events = {\n [Brush.selectors.brush]: {},\n }\n\n private _selection: [number, number] | null = null\n private _firstRender = true\n\n constructor (config?: BrushConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n\n this.brush = this.g\n .append('g')\n .attr('class', s.brush)\n\n const directions: BrushHandleType[] = [{ type: BrushDirection.West }, { type: BrushDirection.East }]\n this.unselectedRange = this.g\n .selectAll(`.${s.unselected}`)\n .data(directions)\n .enter().append('rect')\n .attr('class', s.unselected)\n\n this.handleLines = this.g\n .selectAll(`.${s.handleLine}`)\n .data(directions)\n .enter().append('line')\n .attr('class', s.handleLine)\n }\n\n _render (customDuration?: number): void {\n const { brushBehaviour, config } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n const xScale = this.xScale\n\n brushBehaviour\n .extent([[0, 0], [this._width, this._height]])\n .on('start', this._onBrushStart.bind(this))\n .on('brush', this._onBrushMove.bind(this))\n .on('end', this._onBrushEnd.bind(this))\n\n this.brush\n .call(brushBehaviour)\n .classed('non-draggable', !config.draggable)\n\n const yRange = [this._height, 0]\n const h = yRange[0] - yRange[1]\n\n this.g.selectAll('.handle')\n .attr('y', yRange[1])\n .attr('height', h)\n\n this.unselectedRange\n .attr('y', yRange[1])\n .attr('height', h)\n\n this.handleLines\n .attr('y1', yRange[1] + 10)\n .attr('y2', yRange[1] + h - 10)\n\n // We save the X scale range and set it to the available horizontal space to calculate the selection range in pixels correctly\n const xRange = [0, this._width]\n const xScaleRange = xScale.range()\n xScale.range(xRange)\n const selectionMin = clamp(xScale((config.selection || this._selection)?.[0]) ?? 0, xRange[0], xRange[1])\n const selectionMax = clamp(xScale((config.selection || this._selection)?.[1]) ?? 0, xRange[0], xRange[1])\n xScale.range(xScaleRange) // Restore the X scale range\n\n const selectionLength = selectionMax - selectionMin\n const brushRange = (selectionLength ? [selectionMin, selectionMax] : xRange) as [number, number]\n this._positionHandles(brushRange)\n\n smartTransition(this.brush, duration)\n .call(brushBehaviour.move, brushRange) // Sets up the brush and calls brush events\n .on('end interrupt', () => { this._firstRender = false })\n // We track the first render to not trigger user events on component initialization\n if (!duration) this._firstRender = false\n }\n\n _updateSelection (s: [number, number]): void {\n const xRange = [0, this._width]\n this.unselectedRange\n .attr('x', d => d.type === BrushDirection.West ? xRange[0] : s[1])\n .attr('width', d => {\n const length = d.type === BrushDirection.West ? s[0] - xRange[0] : xRange[1] - s[1]\n const lengthClamped = clamp(length, 0, xRange[1] - xRange[0])\n return lengthClamped\n })\n\n this._positionHandles(s)\n\n // D3 sets brush handle height to be too long, so we need to update it\n const yRange = [this._height, 0]\n const h = yRange[0] - yRange[1]\n this.g.selectAll('.handle')\n .attr('y', yRange[1])\n .attr('height', h)\n }\n\n private _positionHandles (s: [number, number]): void {\n const { config } = this\n\n this.brush.selectAll<SVGRectElement, BrushHandleType>('.handle')\n .attr('width', config.handleWidth)\n .attr('x', d => {\n if (!s) return 0\n const west = d.type === BrushDirection.West\n const inside = config.handlePosition === Arrangement.Inside\n\n if (west) return s[0] + (inside ? 0 : -config.handleWidth)\n else return s[1] + (inside ? -config.handleWidth : 0)\n })\n\n this.handleLines\n .attr('transform', d => {\n if (!s) return null\n const west = d.type === BrushDirection.West\n const inside = config.handlePosition === Arrangement.Inside\n return `translate(${west\n ? s[0] - (-1) ** Number(inside) * config.handleWidth / 2\n : s[1] + (-1) ** Number(inside) * config.handleWidth / 2},0)`\n })\n }\n\n _onBrush (event: D3BrushEvent<Datum>): void {\n const { config } = this\n const xScale = this.xScale\n const xRange = [0, this._width]\n const s = (event?.selection || xRange) as [number, number]\n const userDriven = !!event?.sourceEvent\n // Handle edge cases:\n // (event?.selection === null) happens when user clicks to reset the selection\n // (s?.[0] === s?.[1]) happens when user drags the selection out of range\n if (userDriven && (\n (event?.selection === null) || // happens when user clicks to reset the selection\n (s?.[0] === s?.[1]) || // happens when user drags the selection out of range\n (s?.[0] < xRange[0]) || //\n (s?.[0] > xRange[1]) || // happens when you drag the brush and the domain updates\n (s?.[1] < xRange[0]) || // to a smaller one and brush goes out of range\n (s?.[1] > xRange[1]) //\n )) {\n this.brush.call(this.brushBehaviour.move, xRange) // Will trigger the 'brush end' callback with `range`\n return\n }\n\n // When you reset selection by clicking on a non-selected brush area, D3 triggers the brush event twice.\n // The first call will have equal selection coordinates (e.g. [441, 441]), the second call will have the full range (e.g. [0, 700]).\n // To avoid unnecessary render from the first call we skip it\n if (s[0] !== s[1] && isNumber(s[0]) && isNumber(s[1])) {\n // We save the X scale range and set it to the available horizontal space to invert the selection correctly\n const xScaleRange = xScale.range()\n xScale.range(xRange)\n const selectedDomain = s.map(n => +xScale.invert(n)) as [number, number]\n\n if (userDriven) {\n // Constraint the selection if configured\n const xDomain = xScale.domain() as [number, number]\n const xDomainLength = Math.abs(xDomain[1] - xDomain[0])\n const selectionLength = Math.abs(selectedDomain[1] - selectedDomain[0])\n\n if (config.selectionMinLength >= xDomainLength) {\n console.warn('Unovis | Brush: Configured `selectionMinLength` is bigger than the brush domain')\n }\n\n if ((selectionLength < config.selectionMinLength) && (config.selectionMinLength < xDomainLength)) {\n const selection = config.selection ?? this._selection\n const range = [xScale(selection[0]), xScale(selection[1])] as [number, number]\n this.brush.call(this.brushBehaviour.move, range) // Will trigger the 'brush end' callback with `range`\n // Restore the X scale range\n xScale.range(xScaleRange)\n return\n } else {\n this._selection = selectedDomain\n // Restore the X scale range\n xScale.range(xScaleRange)\n }\n }\n\n this._updateSelection(s)\n if (!this._firstRender) config.onBrush(selectedDomain, event, userDriven)\n }\n }\n\n _onBrushStart (event: D3BrushEvent<Datum>): void {\n const { config } = this\n\n this._onBrush(event)\n if (!this._firstRender) config.onBrushStart(this._selection, event, !!event?.sourceEvent)\n }\n\n _onBrushMove (event: D3BrushEvent<Datum>): void {\n const { config } = this\n\n this._onBrush(event)\n if (!this._firstRender) config.onBrushMove(this._selection, event, !!event?.sourceEvent)\n }\n\n _onBrushEnd (event: D3BrushEvent<Datum>): void {\n const { config } = this\n\n this._onBrush(event)\n if (!this._firstRender) config.onBrushEnd(this._selection, event, !!event?.sourceEvent)\n }\n}\n"],"names":["s.brush","s.unselected","s.handleLine","s"],"mappings":";;;;;;;;;;AAsBM,MAAO,KAAa,SAAQ,eAAmD,CAAA;AAgBnF,IAAA,WAAA,CAAa,MAAoC,EAAA;AAC/C,QAAA,KAAK,EAAE,CAAA;QAfC,IAAc,CAAA,cAAA,GAAG,kBAAiD,CAAA;AAC5E,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAA;AACV,QAAA,IAAA,CAAA,MAAM,GAAgC,IAAI,CAAC,cAAc,CAAA;QAIhE,IAAc,CAAA,cAAA,GAA2B,MAAM,EAAE,CAAA;AACjD,QAAA,IAAA,CAAA,MAAM,GAAG;AACP,YAAA,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,GAAG,EAAE;SAC5B,CAAA;QAEO,IAAU,CAAA,UAAA,GAA4B,IAAI,CAAA;QAC1C,IAAY,CAAA,YAAA,GAAG,IAAI,CAAA;AAIzB,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;AAElC,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;aAChB,MAAM,CAAC,GAAG,CAAC;AACX,aAAA,IAAI,CAAC,OAAO,EAAEA,KAAO,CAAC,CAAA;AAEzB,QAAA,MAAM,UAAU,GAAsB,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,CAAC,CAAA;AACpG,QAAA,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;AAC1B,aAAA,SAAS,CAAC,CAAI,CAAA,EAA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AW,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC,EAAC,KAAK,aAAL,KAAK,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAL,KAAK,CAAE,WAAW,CAAA,CAAC,CAAA;KACzF;AAED,IAAA,WAAW,CAAE,KAA0B,EAAA;AACrC,QAAA,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;AAEvB,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QACpB,IAAI,CAAC,IAAI,CAAC,YAAY;YAAE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC,EAAC,KAAK,aAAL,KAAK,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAL,KAAK,CAAE,WAAW,CAAA,CAAC,CAAA;KACxF;;AAjNM,KAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/brush/index.ts"],"sourcesContent":["import { BrushBehavior, brushX, D3BrushEvent } from 'd3-brush'\nimport { Selection } from 'd3-selection'\n\n// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Utils\nimport { isNumber, clamp } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\n\n// Types\nimport { Arrangement } from 'types/position'\n\n// Config\nimport { BrushDefaultConfig, BrushConfigInterface } from './config'\n\n// Local Types\nimport { BrushDirection, BrushHandleType } from './types'\n\n// Styles\nimport * as s from './style'\n\nexport class Brush<Datum> extends XYComponentCore<Datum, BrushConfigInterface<Datum>> {\n static selectors = s\n protected _defaultConfig = BrushDefaultConfig as BrushConfigInterface<Datum>\n clippable = false // Don't apply clipping path to this component. See XYContainer\n public config: BrushConfigInterface<Datum> = this._defaultConfig\n brush: Selection<SVGGElement, unknown, SVGGElement, unknown>\n unselectedRange: Selection<SVGRectElement, BrushHandleType, SVGGElement, unknown>\n handleLines: Selection<SVGLineElement, BrushHandleType, SVGGElement, unknown>\n brushBehaviour: BrushBehavior<unknown> = brushX()\n events = {\n [Brush.selectors.brush]: {},\n }\n\n private _selection: [number, number] | null = null\n private _firstRender = true\n\n constructor (config?: BrushConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n\n const directions: BrushHandleType[] = [{ type: BrushDirection.West }, { type: BrushDirection.East }]\n this.unselectedRange = this.g\n .selectAll(`.${s.unselected}`)\n .data(directions)\n .enter().append('rect')\n .attr('class', s.unselected)\n\n this.brush = this.g\n .append('g')\n .attr('class', s.brush)\n\n this.handleLines = this.g\n .selectAll(`.${s.handleLine}`)\n .data(directions)\n .enter().append('line')\n .attr('class', s.handleLine)\n }\n\n _render (customDuration?: number): void {\n const { brushBehaviour, config } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n const xScale = this.xScale\n\n brushBehaviour\n .extent([[0, 0], [this._width, this._height]])\n .on('start', this._onBrushStart.bind(this))\n .on('brush', this._onBrushMove.bind(this))\n .on('end', this._onBrushEnd.bind(this))\n\n this.brush\n .call(brushBehaviour)\n .classed('non-draggable', !config.draggable)\n\n const yRange = [this._height, 0]\n const h = yRange[0] - yRange[1]\n\n this.g.selectAll('.handle')\n .attr('y', yRange[1])\n .attr('height', h)\n\n this.unselectedRange\n .attr('y', yRange[1])\n .attr('height', h)\n\n this.handleLines\n .attr('y1', yRange[1] + 10)\n .attr('y2', yRange[1] + h - 10)\n\n // We save the X scale range and set it to the available horizontal space to calculate the selection range in pixels correctly\n const xRange = [0, this._width]\n const xScaleRange = xScale.range()\n xScale.range(xRange)\n const selectionMin = clamp(xScale((config.selection || this._selection)?.[0]) ?? 0, xRange[0], xRange[1])\n const selectionMax = clamp(xScale((config.selection || this._selection)?.[1]) ?? 0, xRange[0], xRange[1])\n xScale.range(xScaleRange) // Restore the X scale range\n\n const selectionLength = selectionMax - selectionMin\n const brushRange = (selectionLength ? [selectionMin, selectionMax] : xRange) as [number, number]\n this._positionHandles(brushRange)\n\n smartTransition(this.brush, duration)\n .call(brushBehaviour.move, brushRange) // Sets up the brush and calls brush events\n .on('end interrupt', () => { this._firstRender = false })\n // We track the first render to not trigger user events on component initialization\n if (!duration) this._firstRender = false\n }\n\n _updateSelection (s: [number, number]): void {\n const xRange = [0, this._width]\n this.unselectedRange\n .attr('x', d => d.type === BrushDirection.West ? xRange[0] : s[1])\n .attr('width', d => {\n const length = d.type === BrushDirection.West ? s[0] - xRange[0] : xRange[1] - s[1]\n const lengthClamped = clamp(length, 0, xRange[1] - xRange[0])\n return lengthClamped\n })\n\n this._positionHandles(s)\n\n // D3 sets brush handle height to be too long, so we need to update it\n const yRange = [this._height, 0]\n const h = yRange[0] - yRange[1]\n this.g.selectAll('.handle')\n .attr('y', yRange[1])\n .attr('height', h)\n }\n\n private _positionHandles (s: [number, number]): void {\n const { config } = this\n\n this.brush.selectAll<SVGRectElement, BrushHandleType>('.handle')\n .attr('width', config.handleWidth)\n .attr('x', d => {\n if (!s) return 0\n const west = d.type === BrushDirection.West\n const inside = config.handlePosition === Arrangement.Inside\n\n if (west) return s[0] + (inside ? 0 : -config.handleWidth)\n else return s[1] + (inside ? -config.handleWidth : 0)\n })\n\n this.handleLines\n .attr('transform', d => {\n if (!s) return null\n const west = d.type === BrushDirection.West\n const inside = config.handlePosition === Arrangement.Inside\n return `translate(${west\n ? s[0] - (-1) ** Number(inside) * config.handleWidth / 2\n : s[1] + (-1) ** Number(inside) * config.handleWidth / 2},0)`\n })\n }\n\n _onBrush (event: D3BrushEvent<Datum>): void {\n const { config } = this\n const xScale = this.xScale\n const xRange = [0, this._width]\n const s = (event?.selection || xRange) as [number, number]\n const userDriven = !!event?.sourceEvent\n // Handle edge cases:\n // (event?.selection === null) happens when user clicks to reset the selection\n // (s?.[0] === s?.[1]) happens when user drags the selection out of range\n if (userDriven && (\n (event?.selection === null) || // happens when user clicks to reset the selection\n (s?.[0] === s?.[1]) || // happens when user drags the selection out of range\n (s?.[0] < xRange[0]) || //\n (s?.[0] > xRange[1]) || // happens when you drag the brush and the domain updates\n (s?.[1] < xRange[0]) || // to a smaller one and brush goes out of range\n (s?.[1] > xRange[1]) //\n )) {\n this.brush.call(this.brushBehaviour.move, xRange) // Will trigger the 'brush end' callback with `range`\n return\n }\n\n // When you reset selection by clicking on a non-selected brush area, D3 triggers the brush event twice.\n // The first call will have equal selection coordinates (e.g. [441, 441]), the second call will have the full range (e.g. [0, 700]).\n // To avoid unnecessary render from the first call we skip it\n if (s[0] !== s[1] && isNumber(s[0]) && isNumber(s[1])) {\n // We save the X scale range and set it to the available horizontal space to invert the selection correctly\n const xScaleRange = xScale.range()\n xScale.range(xRange)\n const selectedDomain = s.map(n => +xScale.invert(n)) as [number, number]\n\n if (userDriven) {\n // Constraint the selection if configured\n const xDomain = xScale.domain() as [number, number]\n const xDomainLength = Math.abs(xDomain[1] - xDomain[0])\n const selectionLength = Math.abs(selectedDomain[1] - selectedDomain[0])\n\n if (config.selectionMinLength >= xDomainLength) {\n console.warn('Unovis | Brush: Configured `selectionMinLength` is bigger than the brush domain')\n }\n\n if ((selectionLength < config.selectionMinLength) && (config.selectionMinLength < xDomainLength)) {\n const selection = config.selection ?? this._selection\n const range = [xScale(selection[0]), xScale(selection[1])] as [number, number]\n this.brush.call(this.brushBehaviour.move, range) // Will trigger the 'brush end' callback with `range`\n // Restore the X scale range\n xScale.range(xScaleRange)\n return\n } else {\n this._selection = selectedDomain\n // Restore the X scale range\n xScale.range(xScaleRange)\n }\n }\n\n this._updateSelection(s)\n if (!this._firstRender) config.onBrush(selectedDomain, event, userDriven)\n }\n }\n\n _onBrushStart (event: D3BrushEvent<Datum>): void {\n const { config } = this\n\n this._onBrush(event)\n if (!this._firstRender) config.onBrushStart(this._selection, event, !!event?.sourceEvent)\n }\n\n _onBrushMove (event: D3BrushEvent<Datum>): void {\n const { config } = this\n\n this._onBrush(event)\n if (!this._firstRender) config.onBrushMove(this._selection, event, !!event?.sourceEvent)\n }\n\n _onBrushEnd (event: D3BrushEvent<Datum>): void {\n const { config } = this\n\n this._onBrush(event)\n if (!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IAAA,WAAW,CAAE,KAA0B,EAAA;AACrC,QAAA,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;AAEvB,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QACpB,IAAI,CAAC,IAAI,CAAC,YAAY;YAAE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC,EAAC,KAAK,aAAL,KAAK,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAL,KAAK,CAAE,WAAW,CAAA,CAAC,CAAA;KACxF;;AAjNM,KAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
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.4.2-alpha.0",
4
+ "version": "1.4.2-alpha.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/f5/unovis.git",