@visactor/vrender-components 0.22.5-alpha.1 → 0.22.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.
@@ -203,4 +203,5 @@ class Brush extends base_1.AbstractComponent {
203
203
  }
204
204
  }
205
205
 
206
- exports.Brush = Brush, Brush.defaultAttributes = config_1.DEFAULT_BRUSH_ATTRIBUTES;
206
+ exports.Brush = Brush, Brush.defaultAttributes = config_1.DEFAULT_BRUSH_ATTRIBUTES;
207
+ //# sourceMappingURL=brush.js.map
package/cjs/brush/type.js CHANGED
@@ -8,5 +8,4 @@ Object.defineProperty(exports, "__esModule", {
8
8
  IOperateType.drawStart = "drawStart", IOperateType.drawEnd = "drawEnd", IOperateType.drawing = "drawing",
9
9
  IOperateType.moving = "moving", IOperateType.moveStart = "moveStart", IOperateType.moveEnd = "moveEnd",
10
10
  IOperateType.brushClear = "brushClear";
11
- }(IOperateType = exports.IOperateType || (exports.IOperateType = {}));
12
- //# sourceMappingURL=type.js.map
11
+ }(IOperateType = exports.IOperateType || (exports.IOperateType = {}));
package/cjs/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.22.5-alpha.1";
1
+ export declare const version = "0.22.5";
2
2
  export * from './core/base';
3
3
  export * from './core/type';
4
4
  export * from './scrollbar';
package/cjs/index.js CHANGED
@@ -17,7 +17,7 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
17
17
 
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
- }), exports.version = void 0, exports.version = "0.22.5-alpha.1", __exportStar(require("./core/base"), exports),
20
+ }), exports.version = void 0, exports.version = "0.22.5", __exportStar(require("./core/base"), exports),
21
21
  __exportStar(require("./core/type"), exports), __exportStar(require("./scrollbar"), exports),
22
22
  __exportStar(require("./tag"), exports), __exportStar(require("./poptip"), exports),
23
23
  __exportStar(require("./crosshair"), exports), __exportStar(require("./label"), exports),
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,8CAA4B;AAC5B,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,8CAA4B;AAC5B,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,8CAA4B;AAC5B,4CAA0B;AAC1B,yCAAuB;AACvB,2CAAyB;AACzB,+CAA6B","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.22.5-alpha.1\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './weather';\nexport * from './util';\nexport * from './switch';\nexport * from './label-item';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,8CAA4B;AAC5B,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,8CAA4B;AAC5B,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,8CAA4B;AAC5B,4CAA0B;AAC1B,yCAAuB;AACvB,2CAAyB;AACzB,+CAA6B","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.22.5\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './weather';\nexport * from './util';\nexport * from './switch';\nexport * from './label-item';\n"]}
@@ -19,9 +19,9 @@ function bitmapTool(width, height, padding = {
19
19
  }
20
20
 
21
21
  function clampRangeByBitmap($, range) {
22
- const {x1: x1, x2: x2, y1: y1, y2: y2} = range, _x1 = (0, vutils_1.clamp)(x1, 0, $.width), _x2 = (0,
23
- vutils_1.clamp)(x2, 0, $.width), _y1 = (0, vutils_1.clamp)(y1, 0, $.height), _y2 = (0,
24
- vutils_1.clamp)(y2, 0, $.height);
22
+ const {x1: x1, x2: x2, y1: y1, y2: y2} = range, {top: top = 0, left: left = 0, right: right = 0, bottom: bottom = 0} = $.padding, _x1 = (0,
23
+ vutils_1.clamp)(x1, -left, $.width + right), _x2 = (0, vutils_1.clamp)(x2, -left, $.width + right), _y1 = (0,
24
+ vutils_1.clamp)(y1, -top, $.height + bottom), _y2 = (0, vutils_1.clamp)(y2, -top, $.height + bottom);
25
25
  return {
26
26
  x1: $.x(_x1),
27
27
  x2: $.x(_x2),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/label/overlap/scaler.ts"],"names":[],"mappings":";;;AACA,6CAAuD;AACvD,qCAAkC;AAiClC,SAAgB,UAAU,CACxB,KAAa,EACb,MAAc,EACd,UAA4E,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;IAEpH,MAAM,EAAE,GAAG,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC;IAC7D,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAC7D,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;IACrD,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,GAAG,MAAM,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;IAE3C,KAAK,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,IAAA,eAAM,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAClC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI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AAI,KAAK,EAAE;QACT,OAAO,kBAAkB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;KACrC;IAED,OAAO;QACL,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QACjB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QACjB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QACjB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;KAClB,CAAC;AACJ,CAAC;AAXD,oCAWC","file":"scaler.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport { clamp as clampRange } from '@visactor/vutils';\nimport { bitmap } from './bitmap';\n\n/**\n * 防重叠逻辑参考 https://github.com/vega/vega/\n * Copyright (c) 2015-2023, University of Washington Interactive Data Lab\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n 3. Neither the name of the copyright holder nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nexport function bitmapTool(\n width: number,\n height: number,\n padding: { top?: number; left?: number; right?: number; bottom?: number } = { top: 0, left: 0, right: 0, bottom: 0 }\n) {\n const { top = 0, left = 0, right = 0, bottom = 0 } = padding;\n const ratio = Math.max(1, Math.sqrt((width * height) / 1e6));\n const w = ~~((width + left + right + ratio) / ratio);\n const h = ~~((height + top + bottom + ratio) / ratio);\n const scale = (_: number) => ~~(_ / ratio);\n\n scale.bitmap = () => bitmap(w, h);\n scale.x = (_: number) => ~~((_ + left) / ratio);\n scale.y = (_: number) => ~~((_ + top) / ratio);\n\n scale.ratio = ratio;\n scale.padding = padding;\n scale.width = width;\n scale.height = height;\n\n return scale;\n}\n\nexport function clampRangeByBitmap($: BitmapTool, range: IBoundsLike) {\n const { x1, x2, y1, y2 } = range;\n const _x1 = clampRange(x1, 0, $.width);\n const _x2 = clampRange(x2, 0, $.width);\n const _y1 = clampRange(y1, 0, $.height);\n const _y2 = clampRange(y2, 0, $.height);\n return {\n x1: $.x(_x1),\n x2: $.x(_x2),\n y1: $.y(_y1),\n y2: $.y(_y2)\n };\n}\n\nexport function boundToRange($: BitmapTool, bound: IBoundsLike, clamp: boolean = false) {\n if (clamp) {\n return clampRangeByBitmap($, bound);\n }\n\n return {\n x1: $.x(bound.x1),\n x2: $.x(bound.x2),\n y1: $.y(bound.y1),\n y2: $.y(bound.y2)\n };\n}\n\nexport type BitmapTool = ReturnType<typeof bitmapTool>;\n"]}
1
+ {"version":3,"sources":["../src/label/overlap/scaler.ts"],"names":[],"mappings":";;;AACA,6CAAuD;AACvD,qCAAkC;AA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AAC,CAAC,EAAE,KAAK,CAAC,CAAC;KACrC;IAED,OAAO;QACL,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QACjB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QACjB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QACjB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;KAClB,CAAC;AACJ,CAAC;AAXD,oCAWC","file":"scaler.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport { clamp as clampRange } from '@visactor/vutils';\nimport { bitmap } from './bitmap';\n\n/**\n * 防重叠逻辑参考 https://github.com/vega/vega/\n * Copyright (c) 2015-2023, University of Washington Interactive Data Lab\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n 3. Neither the name of the copyright holder nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nexport function bitmapTool(\n width: number,\n height: number,\n padding: { top?: number; left?: number; right?: number; bottom?: number } = { top: 0, left: 0, right: 0, bottom: 0 }\n) {\n const { top = 0, left = 0, right = 0, bottom = 0 } = padding;\n const ratio = Math.max(1, Math.sqrt((width * height) / 1e6));\n const w = ~~((width + left + right + ratio) / ratio);\n const h = ~~((height + top + bottom + ratio) / ratio);\n const scale = (_: number) => ~~(_ / ratio);\n\n scale.bitmap = () => bitmap(w, h);\n scale.x = (_: number) => ~~((_ + left) / ratio);\n scale.y = (_: number) => ~~((_ + top) / ratio);\n\n scale.ratio = ratio;\n scale.padding = padding;\n scale.width = width;\n scale.height = height;\n\n return scale;\n}\n\nexport function clampRangeByBitmap($: BitmapTool, range: IBoundsLike) {\n const { x1, x2, y1, y2 } = range;\n const { top = 0, left = 0, right = 0, bottom = 0 } = $.padding;\n const _x1 = clampRange(x1, -left, $.width + right);\n const _x2 = clampRange(x2, -left, $.width + right);\n const _y1 = clampRange(y1, -top, $.height + bottom);\n const _y2 = clampRange(y2, -top, $.height + bottom);\n return {\n x1: $.x(_x1),\n x2: $.x(_x2),\n y1: $.y(_y1),\n y2: $.y(_y2)\n };\n}\n\nexport function boundToRange($: BitmapTool, bound: IBoundsLike, clamp: boolean = false) {\n if (clamp) {\n return clampRangeByBitmap($, bound);\n }\n\n return {\n x1: $.x(bound.x1),\n x2: $.x(bound.x2),\n y1: $.y(bound.y1),\n y2: $.y(bound.y2)\n };\n}\n\nexport type BitmapTool = ReturnType<typeof bitmapTool>;\n"]}
package/dist/index.es.js CHANGED
@@ -20023,10 +20023,11 @@ function bitmapTool(width, height, padding = { top: 0, left: 0, right: 0, bottom
20023
20023
  }
20024
20024
  function clampRangeByBitmap($, range) {
20025
20025
  const { x1, x2, y1, y2 } = range;
20026
- const _x1 = clamp(x1, 0, $.width);
20027
- const _x2 = clamp(x2, 0, $.width);
20028
- const _y1 = clamp(y1, 0, $.height);
20029
- const _y2 = clamp(y2, 0, $.height);
20026
+ const { top = 0, left = 0, right = 0, bottom = 0 } = $.padding;
20027
+ const _x1 = clamp(x1, -left, $.width + right);
20028
+ const _x2 = clamp(x2, -left, $.width + right);
20029
+ const _y1 = clamp(y1, -top, $.height + bottom);
20030
+ const _y2 = clamp(y2, -top, $.height + bottom);
20030
20031
  return {
20031
20032
  x1: $.x(_x1),
20032
20033
  x2: $.x(_x2),
@@ -31471,6 +31472,6 @@ StoryLabelItem.defaultAttributes = {
31471
31472
  theme: 'default'
31472
31473
  };
31473
31474
 
31474
- const version = "0.22.5-alpha.1";
31475
+ const version = "0.22.5";
31475
31476
 
31476
31477
  export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PolygonSectorCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, StoryLabelItem, Switch, SymbolLabel, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
package/es/brush/brush.js CHANGED
@@ -209,4 +209,5 @@ export class Brush extends AbstractComponent {
209
209
  }
210
210
  }
211
211
 
212
- Brush.defaultAttributes = DEFAULT_BRUSH_ATTRIBUTES;
212
+ Brush.defaultAttributes = DEFAULT_BRUSH_ATTRIBUTES;
213
+ //# sourceMappingURL=brush.js.map
package/es/brush/type.js CHANGED
@@ -4,5 +4,4 @@ export var IOperateType;
4
4
  IOperateType.drawStart = "drawStart", IOperateType.drawEnd = "drawEnd", IOperateType.drawing = "drawing",
5
5
  IOperateType.moving = "moving", IOperateType.moveStart = "moveStart", IOperateType.moveEnd = "moveEnd",
6
6
  IOperateType.brushClear = "brushClear";
7
- }(IOperateType || (IOperateType = {}));
8
- //# sourceMappingURL=type.js.map
7
+ }(IOperateType || (IOperateType = {}));
package/es/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.22.5-alpha.1";
1
+ export declare const version = "0.22.5";
2
2
  export * from './core/base';
3
3
  export * from './core/type';
4
4
  export * from './scrollbar';
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const version = "0.22.5-alpha.1";
1
+ export const version = "0.22.5";
2
2
 
3
3
  export * from "./core/base";
4
4
 
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAExC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.22.5-alpha.1\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './weather';\nexport * from './util';\nexport * from './switch';\nexport * from './label-item';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAEhC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.22.5\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './weather';\nexport * from './util';\nexport * from './switch';\nexport * from './label-item';\n"]}
@@ -15,7 +15,7 @@ export function bitmapTool(width, height, padding = {
15
15
  }
16
16
 
17
17
  export function clampRangeByBitmap($, range) {
18
- const {x1: x1, x2: x2, y1: y1, y2: y2} = range, _x1 = clampRange(x1, 0, $.width), _x2 = clampRange(x2, 0, $.width), _y1 = clampRange(y1, 0, $.height), _y2 = clampRange(y2, 0, $.height);
18
+ const {x1: x1, x2: x2, y1: y1, y2: y2} = range, {top: top = 0, left: left = 0, right: right = 0, bottom: bottom = 0} = $.padding, _x1 = clampRange(x1, -left, $.width + right), _x2 = clampRange(x2, -left, $.width + right), _y1 = clampRange(y1, -top, $.height + bottom), _y2 = clampRange(y2, -top, $.height + bottom);
19
19
  return {
20
20
  x1: $.x(_x1),
21
21
  x2: $.x(_x2),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/label/overlap/scaler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;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C,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QACjB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;KAClB,CAAC;AACJ,CAAC","file":"scaler.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport { clamp as clampRange } from '@visactor/vutils';\nimport { bitmap } from './bitmap';\n\n/**\n * 防重叠逻辑参考 https://github.com/vega/vega/\n * Copyright (c) 2015-2023, University of Washington Interactive Data Lab\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n 3. Neither the name of the copyright holder nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nexport function bitmapTool(\n width: number,\n height: number,\n padding: { top?: number; left?: number; right?: number; bottom?: number } = { top: 0, left: 0, right: 0, bottom: 0 }\n) {\n const { top = 0, left = 0, right = 0, bottom = 0 } = padding;\n const ratio = Math.max(1, Math.sqrt((width * height) / 1e6));\n const w = ~~((width + left + right + ratio) / ratio);\n const h = ~~((height + top + bottom + ratio) / ratio);\n const scale = (_: number) => ~~(_ / ratio);\n\n scale.bitmap = () => bitmap(w, h);\n scale.x = (_: number) => ~~((_ + left) / ratio);\n scale.y = (_: number) => ~~((_ + top) / ratio);\n\n scale.ratio = ratio;\n scale.padding = padding;\n scale.width = width;\n scale.height = height;\n\n return scale;\n}\n\nexport function clampRangeByBitmap($: BitmapTool, range: IBoundsLike) {\n const { x1, x2, y1, y2 } = range;\n const _x1 = clampRange(x1, 0, $.width);\n const _x2 = clampRange(x2, 0, $.width);\n const _y1 = clampRange(y1, 0, $.height);\n const _y2 = clampRange(y2, 0, $.height);\n return {\n x1: $.x(_x1),\n x2: $.x(_x2),\n y1: $.y(_y1),\n y2: $.y(_y2)\n };\n}\n\nexport function boundToRange($: BitmapTool, bound: IBoundsLike, clamp: boolean = false) {\n if (clamp) {\n return clampRangeByBitmap($, bound);\n }\n\n return {\n x1: $.x(bound.x1),\n x2: $.x(bound.x2),\n y1: $.y(bound.y1),\n y2: $.y(bound.y2)\n };\n}\n\nexport type BitmapTool = ReturnType<typeof bitmapTool>;\n"]}
1
+ {"version":3,"sources":["../src/label/overlap/scaler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAiClC,MAAM,UAAU,UAAU,CACxB,KAAa,EACb,MAAc,EACd,UAA4E,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;IAEpH,MAAM,EAAE,GA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KAAK,CAAC,EAAE,CAAC;QACjB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;KAClB,CAAC;AACJ,CAAC","file":"scaler.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport { clamp as clampRange } from '@visactor/vutils';\nimport { bitmap } from './bitmap';\n\n/**\n * 防重叠逻辑参考 https://github.com/vega/vega/\n * Copyright (c) 2015-2023, University of Washington Interactive Data Lab\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n 3. Neither the name of the copyright holder nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nexport function bitmapTool(\n width: number,\n height: number,\n padding: { top?: number; left?: number; right?: number; bottom?: number } = { top: 0, left: 0, right: 0, bottom: 0 }\n) {\n const { top = 0, left = 0, right = 0, bottom = 0 } = padding;\n const ratio = Math.max(1, Math.sqrt((width * height) / 1e6));\n const w = ~~((width + left + right + ratio) / ratio);\n const h = ~~((height + top + bottom + ratio) / ratio);\n const scale = (_: number) => ~~(_ / ratio);\n\n scale.bitmap = () => bitmap(w, h);\n scale.x = (_: number) => ~~((_ + left) / ratio);\n scale.y = (_: number) => ~~((_ + top) / ratio);\n\n scale.ratio = ratio;\n scale.padding = padding;\n scale.width = width;\n scale.height = height;\n\n return scale;\n}\n\nexport function clampRangeByBitmap($: BitmapTool, range: IBoundsLike) {\n const { x1, x2, y1, y2 } = range;\n const { top = 0, left = 0, right = 0, bottom = 0 } = $.padding;\n const _x1 = clampRange(x1, -left, $.width + right);\n const _x2 = clampRange(x2, -left, $.width + right);\n const _y1 = clampRange(y1, -top, $.height + bottom);\n const _y2 = clampRange(y2, -top, $.height + bottom);\n return {\n x1: $.x(_x1),\n x2: $.x(_x2),\n y1: $.y(_y1),\n y2: $.y(_y2)\n };\n}\n\nexport function boundToRange($: BitmapTool, bound: IBoundsLike, clamp: boolean = false) {\n if (clamp) {\n return clampRangeByBitmap($, bound);\n }\n\n return {\n x1: $.x(bound.x1),\n x2: $.x(bound.x2),\n y1: $.y(bound.y1),\n y2: $.y(bound.y2)\n };\n}\n\nexport type BitmapTool = ReturnType<typeof bitmapTool>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vrender-components",
3
- "version": "0.22.5-alpha.1",
3
+ "version": "0.22.5",
4
4
  "description": "components library for dp visualization",
5
5
  "sideEffects": false,
6
6
  "main": "cjs/index.js",
@@ -14,8 +14,8 @@
14
14
  "dependencies": {
15
15
  "@visactor/vutils": "~0.19.4",
16
16
  "@visactor/vscale": "~0.19.4",
17
- "@visactor/vrender-core": "0.22.5-alpha.1",
18
- "@visactor/vrender-kits": "0.22.5-alpha.1"
17
+ "@visactor/vrender-core": "0.22.5",
18
+ "@visactor/vrender-kits": "0.22.5"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@rushstack/eslint-patch": "~1.1.4",
@@ -29,9 +29,9 @@
29
29
  "vite": "3.2.6",
30
30
  "typescript": "4.9.5",
31
31
  "cross-env": "^7.0.3",
32
- "@internal/eslint-config": "0.0.1",
32
+ "@internal/bundler": "0.0.1",
33
33
  "@internal/ts-config": "0.0.1",
34
- "@internal/bundler": "0.0.1"
34
+ "@internal/eslint-config": "0.0.1"
35
35
  },
36
36
  "keywords": [
37
37
  "VisActor",