@retikz/core 0.0.1-rc.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/LICENSE +21 -0
- package/README.md +2 -0
- package/dist/es/_virtual/jsx-runtime.js +5 -0
- package/dist/es/_virtual/jsx-runtime2.js +4 -0
- package/dist/es/_virtual/react-jsx-runtime.development.js +4 -0
- package/dist/es/_virtual/react-jsx-runtime.production.js +4 -0
- package/dist/es/components/Scope.d.ts +6 -0
- package/dist/es/components/Scope.js +10 -0
- package/dist/es/components/TikZ.d.ts +9 -0
- package/dist/es/components/TikZ.js +12 -0
- package/dist/es/components/draw/Draw.d.ts +18 -0
- package/dist/es/components/draw/Draw.js +34 -0
- package/dist/es/components/draw/InnerDraw.d.ts +13 -0
- package/dist/es/components/draw/InnerDraw.js +47 -0
- package/dist/es/components/draw/arrow/index.d.ts +9 -0
- package/dist/es/components/draw/arrow/index.js +10 -0
- package/dist/es/components/draw/arrow/stealth.d.ts +7 -0
- package/dist/es/components/draw/arrow/stealth.js +29 -0
- package/dist/es/components/draw/arrow/types.d.ts +21 -0
- package/dist/es/components/draw/common.d.ts +4 -0
- package/dist/es/components/draw/common.js +12 -0
- package/dist/es/components/draw/index.d.ts +3 -0
- package/dist/es/components/draw/segment/Segment.d.ts +12 -0
- package/dist/es/components/draw/segment/Segment.js +41 -0
- package/dist/es/components/draw/segment/index.d.ts +19 -0
- package/dist/es/components/draw/segment/index.js +41 -0
- package/dist/es/components/draw/segment/useArrow.d.ts +12 -0
- package/dist/es/components/draw/segment/useArrow.js +52 -0
- package/dist/es/components/draw/segment/useConvertWay.d.ts +14 -0
- package/dist/es/components/draw/segment/useConvertWay.js +95 -0
- package/dist/es/components/draw/types.d.ts +29 -0
- package/dist/es/components/node/InnerNode.d.ts +33 -0
- package/dist/es/components/node/InnerNode.js +88 -0
- package/dist/es/components/node/Node.d.ts +54 -0
- package/dist/es/components/node/Node.js +87 -0
- package/dist/es/components/node/_hooks/useNodeConfig.d.ts +3 -0
- package/dist/es/components/node/_hooks/useNodeConfig.js +13 -0
- package/dist/es/components/node/_hooks/useNodeContent.d.ts +4 -0
- package/dist/es/components/node/_hooks/useNodeContent.js +27 -0
- package/dist/es/components/node/_hooks/useNodeShape.d.ts +4 -0
- package/dist/es/components/node/_hooks/useNodeShape.js +34 -0
- package/dist/es/components/node/index.d.ts +3 -0
- package/dist/es/components/node/index.js +4 -0
- package/dist/es/components/pathNode/PathNode.d.ts +39 -0
- package/dist/es/components/pathNode/PathNode.js +76 -0
- package/dist/es/components/pathNode/index.d.ts +3 -0
- package/dist/es/components/pathNode/index.js +4 -0
- package/dist/es/components/pathNode/useAnchor.d.ts +6 -0
- package/dist/es/components/pathNode/useAnchor.js +49 -0
- package/dist/es/container/Group.d.ts +6 -0
- package/dist/es/container/Group.js +7 -0
- package/dist/es/container/Surface.d.ts +17 -0
- package/dist/es/container/Surface.js +23 -0
- package/dist/es/elements/Path.d.ts +4 -0
- package/dist/es/elements/Path.js +13 -0
- package/dist/es/elements/Rect.d.ts +6 -0
- package/dist/es/elements/Rect.js +8 -0
- package/dist/es/elements/Text.d.ts +19 -0
- package/dist/es/elements/Text.js +35 -0
- package/dist/es/hooks/context/useCalculate.d.ts +7 -0
- package/dist/es/hooks/context/useCalculate.js +9 -0
- package/dist/es/hooks/context/useNodes.d.ts +9 -0
- package/dist/es/hooks/context/useNodes.js +33 -0
- package/dist/es/hooks/context/usePath.d.ts +13 -0
- package/dist/es/hooks/context/usePath.js +20 -0
- package/dist/es/hooks/context/useScope.d.ts +11 -0
- package/dist/es/hooks/context/useScope.js +7 -0
- package/dist/es/hooks/useForceUpdate.d.ts +2 -0
- package/dist/es/hooks/useForceUpdate.js +8 -0
- package/dist/es/index.d.ts +10 -0
- package/dist/es/index.js +12 -0
- package/dist/es/model/component/node.d.ts +45 -0
- package/dist/es/model/component/node.js +164 -0
- package/dist/es/model/component/path.d.ts +19 -0
- package/dist/es/model/component/path.js +47 -0
- package/dist/es/model/equation/line.d.ts +21 -0
- package/dist/es/model/equation/line.js +75 -0
- package/dist/es/model/geometry/point/DescartesPoint.d.ts +21 -0
- package/dist/es/model/geometry/point/DescartesPoint.js +50 -0
- package/dist/es/model/geometry/point/PolarPoint.d.ts +14 -0
- package/dist/es/model/geometry/point/PolarPoint.js +27 -0
- package/dist/es/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js +338 -0
- package/dist/es/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js +13 -0
- package/dist/es/node_modules/.pnpm/d3-path@3.1.0/node_modules/d3-path/src/path.js +88 -0
- package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/array.js +6 -0
- package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/constant.js +8 -0
- package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linear.js +39 -0
- package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/line.js +41 -0
- package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/path.js +19 -0
- package/dist/es/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/point.js +10 -0
- package/dist/es/node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react-jsx-runtime.development.js +20 -0
- package/dist/es/node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react-jsx-runtime.production.js +41 -0
- package/dist/es/node_modules/.pnpm/react@19.0.0/node_modules/react/jsx-runtime.js +17 -0
- package/dist/es/types/coordinate/descartes.d.ts +23 -0
- package/dist/es/types/coordinate/index.d.ts +5 -0
- package/dist/es/types/coordinate/polar.d.ts +5 -0
- package/dist/es/types/distance/index.d.ts +8 -0
- package/dist/es/types/distance/sep.d.ts +9 -0
- package/dist/es/types/shape/index.d.ts +8 -0
- package/dist/es/types/shape/index.js +9 -0
- package/dist/es/types/shape/rect.d.ts +25 -0
- package/dist/es/types/shape/rect.js +30 -0
- package/dist/es/types/svg/font.d.ts +10 -0
- package/dist/es/types/svg/stroke.d.ts +10 -0
- package/dist/es/types/tikz/index.d.ts +6 -0
- package/dist/es/utils/compare.d.ts +4 -0
- package/dist/es/utils/compare.js +20 -0
- package/dist/es/utils/css.d.ts +6 -0
- package/dist/es/utils/css.js +26 -0
- package/dist/es/utils/math.d.ts +9 -0
- package/dist/es/utils/math.js +26 -0
- package/dist/es/utils/string.d.ts +7 -0
- package/dist/es/utils/string.js +7 -0
- package/dist/es/utils/style/font.d.ts +17 -0
- package/dist/es/utils/style/font.js +34 -0
- package/dist/es/utils/style/stroke.d.ts +19 -0
- package/dist/es/utils/style/stroke.js +40 -0
- package/dist/lib/_virtual/jsx-runtime.cjs +5 -0
- package/dist/lib/_virtual/jsx-runtime2.cjs +4 -0
- package/dist/lib/_virtual/react-jsx-runtime.development.cjs +4 -0
- package/dist/lib/_virtual/react-jsx-runtime.production.cjs +4 -0
- package/dist/lib/components/Scope.cjs +10 -0
- package/dist/lib/components/Scope.d.ts +6 -0
- package/dist/lib/components/TikZ.cjs +12 -0
- package/dist/lib/components/TikZ.d.ts +9 -0
- package/dist/lib/components/draw/Draw.cjs +34 -0
- package/dist/lib/components/draw/Draw.d.ts +18 -0
- package/dist/lib/components/draw/InnerDraw.cjs +47 -0
- package/dist/lib/components/draw/InnerDraw.d.ts +13 -0
- package/dist/lib/components/draw/arrow/index.cjs +10 -0
- package/dist/lib/components/draw/arrow/index.d.ts +9 -0
- package/dist/lib/components/draw/arrow/stealth.cjs +29 -0
- package/dist/lib/components/draw/arrow/stealth.d.ts +7 -0
- package/dist/lib/components/draw/arrow/types.d.ts +21 -0
- package/dist/lib/components/draw/common.cjs +12 -0
- package/dist/lib/components/draw/common.d.ts +4 -0
- package/dist/lib/components/draw/index.d.ts +3 -0
- package/dist/lib/components/draw/segment/Segment.cjs +41 -0
- package/dist/lib/components/draw/segment/Segment.d.ts +12 -0
- package/dist/lib/components/draw/segment/index.cjs +41 -0
- package/dist/lib/components/draw/segment/index.d.ts +19 -0
- package/dist/lib/components/draw/segment/useArrow.cjs +52 -0
- package/dist/lib/components/draw/segment/useArrow.d.ts +12 -0
- package/dist/lib/components/draw/segment/useConvertWay.cjs +95 -0
- package/dist/lib/components/draw/segment/useConvertWay.d.ts +14 -0
- package/dist/lib/components/draw/types.d.ts +29 -0
- package/dist/lib/components/node/InnerNode.cjs +88 -0
- package/dist/lib/components/node/InnerNode.d.ts +33 -0
- package/dist/lib/components/node/Node.cjs +87 -0
- package/dist/lib/components/node/Node.d.ts +54 -0
- package/dist/lib/components/node/_hooks/useNodeConfig.cjs +13 -0
- package/dist/lib/components/node/_hooks/useNodeConfig.d.ts +3 -0
- package/dist/lib/components/node/_hooks/useNodeContent.cjs +27 -0
- package/dist/lib/components/node/_hooks/useNodeContent.d.ts +4 -0
- package/dist/lib/components/node/_hooks/useNodeShape.cjs +34 -0
- package/dist/lib/components/node/_hooks/useNodeShape.d.ts +4 -0
- package/dist/lib/components/node/index.cjs +4 -0
- package/dist/lib/components/node/index.d.ts +3 -0
- package/dist/lib/components/pathNode/PathNode.cjs +76 -0
- package/dist/lib/components/pathNode/PathNode.d.ts +39 -0
- package/dist/lib/components/pathNode/index.cjs +4 -0
- package/dist/lib/components/pathNode/index.d.ts +3 -0
- package/dist/lib/components/pathNode/useAnchor.cjs +49 -0
- package/dist/lib/components/pathNode/useAnchor.d.ts +6 -0
- package/dist/lib/container/Group.cjs +7 -0
- package/dist/lib/container/Group.d.ts +6 -0
- package/dist/lib/container/Surface.cjs +23 -0
- package/dist/lib/container/Surface.d.ts +17 -0
- package/dist/lib/elements/Path.cjs +13 -0
- package/dist/lib/elements/Path.d.ts +4 -0
- package/dist/lib/elements/Rect.cjs +8 -0
- package/dist/lib/elements/Rect.d.ts +6 -0
- package/dist/lib/elements/Text.cjs +35 -0
- package/dist/lib/elements/Text.d.ts +19 -0
- package/dist/lib/hooks/context/useCalculate.cjs +9 -0
- package/dist/lib/hooks/context/useCalculate.d.ts +7 -0
- package/dist/lib/hooks/context/useNodes.cjs +33 -0
- package/dist/lib/hooks/context/useNodes.d.ts +9 -0
- package/dist/lib/hooks/context/usePath.cjs +20 -0
- package/dist/lib/hooks/context/usePath.d.ts +13 -0
- package/dist/lib/hooks/context/useScope.cjs +7 -0
- package/dist/lib/hooks/context/useScope.d.ts +11 -0
- package/dist/lib/hooks/useForceUpdate.cjs +8 -0
- package/dist/lib/hooks/useForceUpdate.d.ts +2 -0
- package/dist/lib/index.cjs +12 -0
- package/dist/lib/index.d.ts +10 -0
- package/dist/lib/model/component/node.cjs +164 -0
- package/dist/lib/model/component/node.d.ts +45 -0
- package/dist/lib/model/component/path.cjs +47 -0
- package/dist/lib/model/component/path.d.ts +19 -0
- package/dist/lib/model/equation/line.cjs +75 -0
- package/dist/lib/model/equation/line.d.ts +21 -0
- package/dist/lib/model/geometry/point/DescartesPoint.cjs +50 -0
- package/dist/lib/model/geometry/point/DescartesPoint.d.ts +21 -0
- package/dist/lib/model/geometry/point/PolarPoint.cjs +27 -0
- package/dist/lib/model/geometry/point/PolarPoint.d.ts +14 -0
- package/dist/lib/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.cjs +338 -0
- package/dist/lib/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.cjs +13 -0
- package/dist/lib/node_modules/.pnpm/d3-path@3.1.0/node_modules/d3-path/src/path.cjs +88 -0
- package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/array.cjs +6 -0
- package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/constant.cjs +8 -0
- package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linear.cjs +39 -0
- package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/line.cjs +41 -0
- package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/path.cjs +19 -0
- package/dist/lib/node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/point.cjs +10 -0
- package/dist/lib/node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react-jsx-runtime.development.cjs +20 -0
- package/dist/lib/node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react-jsx-runtime.production.cjs +41 -0
- package/dist/lib/node_modules/.pnpm/react@19.0.0/node_modules/react/jsx-runtime.cjs +17 -0
- package/dist/lib/types/coordinate/descartes.d.ts +23 -0
- package/dist/lib/types/coordinate/index.d.ts +5 -0
- package/dist/lib/types/coordinate/polar.d.ts +5 -0
- package/dist/lib/types/distance/index.d.ts +8 -0
- package/dist/lib/types/distance/sep.d.ts +9 -0
- package/dist/lib/types/shape/index.cjs +9 -0
- package/dist/lib/types/shape/index.d.ts +8 -0
- package/dist/lib/types/shape/rect.cjs +30 -0
- package/dist/lib/types/shape/rect.d.ts +25 -0
- package/dist/lib/types/svg/font.d.ts +10 -0
- package/dist/lib/types/svg/stroke.d.ts +10 -0
- package/dist/lib/types/tikz/index.d.ts +6 -0
- package/dist/lib/utils/compare.cjs +20 -0
- package/dist/lib/utils/compare.d.ts +4 -0
- package/dist/lib/utils/css.cjs +26 -0
- package/dist/lib/utils/css.d.ts +6 -0
- package/dist/lib/utils/math.cjs +26 -0
- package/dist/lib/utils/math.d.ts +9 -0
- package/dist/lib/utils/string.cjs +7 -0
- package/dist/lib/utils/string.d.ts +7 -0
- package/dist/lib/utils/style/font.cjs +34 -0
- package/dist/lib/utils/style/font.d.ts +17 -0
- package/dist/lib/utils/style/stroke.cjs +40 -0
- package/dist/lib/utils/style/stroke.d.ts +19 -0
- package/package.json +57 -0
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const define = require("./define.cjs");
|
|
4
|
+
function Color() {
|
|
5
|
+
}
|
|
6
|
+
var darker = 0.7;
|
|
7
|
+
var brighter = 1 / darker;
|
|
8
|
+
var reI = "\\s*([+-]?\\d+)\\s*", reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", reHex = /^#([0-9a-f]{3,8})$/, reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`), reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`), reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`), reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`), reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`), reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
|
|
9
|
+
var named = {
|
|
10
|
+
aliceblue: 15792383,
|
|
11
|
+
antiquewhite: 16444375,
|
|
12
|
+
aqua: 65535,
|
|
13
|
+
aquamarine: 8388564,
|
|
14
|
+
azure: 15794175,
|
|
15
|
+
beige: 16119260,
|
|
16
|
+
bisque: 16770244,
|
|
17
|
+
black: 0,
|
|
18
|
+
blanchedalmond: 16772045,
|
|
19
|
+
blue: 255,
|
|
20
|
+
blueviolet: 9055202,
|
|
21
|
+
brown: 10824234,
|
|
22
|
+
burlywood: 14596231,
|
|
23
|
+
cadetblue: 6266528,
|
|
24
|
+
chartreuse: 8388352,
|
|
25
|
+
chocolate: 13789470,
|
|
26
|
+
coral: 16744272,
|
|
27
|
+
cornflowerblue: 6591981,
|
|
28
|
+
cornsilk: 16775388,
|
|
29
|
+
crimson: 14423100,
|
|
30
|
+
cyan: 65535,
|
|
31
|
+
darkblue: 139,
|
|
32
|
+
darkcyan: 35723,
|
|
33
|
+
darkgoldenrod: 12092939,
|
|
34
|
+
darkgray: 11119017,
|
|
35
|
+
darkgreen: 25600,
|
|
36
|
+
darkgrey: 11119017,
|
|
37
|
+
darkkhaki: 12433259,
|
|
38
|
+
darkmagenta: 9109643,
|
|
39
|
+
darkolivegreen: 5597999,
|
|
40
|
+
darkorange: 16747520,
|
|
41
|
+
darkorchid: 10040012,
|
|
42
|
+
darkred: 9109504,
|
|
43
|
+
darksalmon: 15308410,
|
|
44
|
+
darkseagreen: 9419919,
|
|
45
|
+
darkslateblue: 4734347,
|
|
46
|
+
darkslategray: 3100495,
|
|
47
|
+
darkslategrey: 3100495,
|
|
48
|
+
darkturquoise: 52945,
|
|
49
|
+
darkviolet: 9699539,
|
|
50
|
+
deeppink: 16716947,
|
|
51
|
+
deepskyblue: 49151,
|
|
52
|
+
dimgray: 6908265,
|
|
53
|
+
dimgrey: 6908265,
|
|
54
|
+
dodgerblue: 2003199,
|
|
55
|
+
firebrick: 11674146,
|
|
56
|
+
floralwhite: 16775920,
|
|
57
|
+
forestgreen: 2263842,
|
|
58
|
+
fuchsia: 16711935,
|
|
59
|
+
gainsboro: 14474460,
|
|
60
|
+
ghostwhite: 16316671,
|
|
61
|
+
gold: 16766720,
|
|
62
|
+
goldenrod: 14329120,
|
|
63
|
+
gray: 8421504,
|
|
64
|
+
green: 32768,
|
|
65
|
+
greenyellow: 11403055,
|
|
66
|
+
grey: 8421504,
|
|
67
|
+
honeydew: 15794160,
|
|
68
|
+
hotpink: 16738740,
|
|
69
|
+
indianred: 13458524,
|
|
70
|
+
indigo: 4915330,
|
|
71
|
+
ivory: 16777200,
|
|
72
|
+
khaki: 15787660,
|
|
73
|
+
lavender: 15132410,
|
|
74
|
+
lavenderblush: 16773365,
|
|
75
|
+
lawngreen: 8190976,
|
|
76
|
+
lemonchiffon: 16775885,
|
|
77
|
+
lightblue: 11393254,
|
|
78
|
+
lightcoral: 15761536,
|
|
79
|
+
lightcyan: 14745599,
|
|
80
|
+
lightgoldenrodyellow: 16448210,
|
|
81
|
+
lightgray: 13882323,
|
|
82
|
+
lightgreen: 9498256,
|
|
83
|
+
lightgrey: 13882323,
|
|
84
|
+
lightpink: 16758465,
|
|
85
|
+
lightsalmon: 16752762,
|
|
86
|
+
lightseagreen: 2142890,
|
|
87
|
+
lightskyblue: 8900346,
|
|
88
|
+
lightslategray: 7833753,
|
|
89
|
+
lightslategrey: 7833753,
|
|
90
|
+
lightsteelblue: 11584734,
|
|
91
|
+
lightyellow: 16777184,
|
|
92
|
+
lime: 65280,
|
|
93
|
+
limegreen: 3329330,
|
|
94
|
+
linen: 16445670,
|
|
95
|
+
magenta: 16711935,
|
|
96
|
+
maroon: 8388608,
|
|
97
|
+
mediumaquamarine: 6737322,
|
|
98
|
+
mediumblue: 205,
|
|
99
|
+
mediumorchid: 12211667,
|
|
100
|
+
mediumpurple: 9662683,
|
|
101
|
+
mediumseagreen: 3978097,
|
|
102
|
+
mediumslateblue: 8087790,
|
|
103
|
+
mediumspringgreen: 64154,
|
|
104
|
+
mediumturquoise: 4772300,
|
|
105
|
+
mediumvioletred: 13047173,
|
|
106
|
+
midnightblue: 1644912,
|
|
107
|
+
mintcream: 16121850,
|
|
108
|
+
mistyrose: 16770273,
|
|
109
|
+
moccasin: 16770229,
|
|
110
|
+
navajowhite: 16768685,
|
|
111
|
+
navy: 128,
|
|
112
|
+
oldlace: 16643558,
|
|
113
|
+
olive: 8421376,
|
|
114
|
+
olivedrab: 7048739,
|
|
115
|
+
orange: 16753920,
|
|
116
|
+
orangered: 16729344,
|
|
117
|
+
orchid: 14315734,
|
|
118
|
+
palegoldenrod: 15657130,
|
|
119
|
+
palegreen: 10025880,
|
|
120
|
+
paleturquoise: 11529966,
|
|
121
|
+
palevioletred: 14381203,
|
|
122
|
+
papayawhip: 16773077,
|
|
123
|
+
peachpuff: 16767673,
|
|
124
|
+
peru: 13468991,
|
|
125
|
+
pink: 16761035,
|
|
126
|
+
plum: 14524637,
|
|
127
|
+
powderblue: 11591910,
|
|
128
|
+
purple: 8388736,
|
|
129
|
+
rebeccapurple: 6697881,
|
|
130
|
+
red: 16711680,
|
|
131
|
+
rosybrown: 12357519,
|
|
132
|
+
royalblue: 4286945,
|
|
133
|
+
saddlebrown: 9127187,
|
|
134
|
+
salmon: 16416882,
|
|
135
|
+
sandybrown: 16032864,
|
|
136
|
+
seagreen: 3050327,
|
|
137
|
+
seashell: 16774638,
|
|
138
|
+
sienna: 10506797,
|
|
139
|
+
silver: 12632256,
|
|
140
|
+
skyblue: 8900331,
|
|
141
|
+
slateblue: 6970061,
|
|
142
|
+
slategray: 7372944,
|
|
143
|
+
slategrey: 7372944,
|
|
144
|
+
snow: 16775930,
|
|
145
|
+
springgreen: 65407,
|
|
146
|
+
steelblue: 4620980,
|
|
147
|
+
tan: 13808780,
|
|
148
|
+
teal: 32896,
|
|
149
|
+
thistle: 14204888,
|
|
150
|
+
tomato: 16737095,
|
|
151
|
+
turquoise: 4251856,
|
|
152
|
+
violet: 15631086,
|
|
153
|
+
wheat: 16113331,
|
|
154
|
+
white: 16777215,
|
|
155
|
+
whitesmoke: 16119285,
|
|
156
|
+
yellow: 16776960,
|
|
157
|
+
yellowgreen: 10145074
|
|
158
|
+
};
|
|
159
|
+
define.default(Color, color, {
|
|
160
|
+
copy(channels) {
|
|
161
|
+
return Object.assign(new this.constructor(), this, channels);
|
|
162
|
+
},
|
|
163
|
+
displayable() {
|
|
164
|
+
return this.rgb().displayable();
|
|
165
|
+
},
|
|
166
|
+
hex: color_formatHex,
|
|
167
|
+
// Deprecated! Use color.formatHex.
|
|
168
|
+
formatHex: color_formatHex,
|
|
169
|
+
formatHex8: color_formatHex8,
|
|
170
|
+
formatHsl: color_formatHsl,
|
|
171
|
+
formatRgb: color_formatRgb,
|
|
172
|
+
toString: color_formatRgb
|
|
173
|
+
});
|
|
174
|
+
function color_formatHex() {
|
|
175
|
+
return this.rgb().formatHex();
|
|
176
|
+
}
|
|
177
|
+
function color_formatHex8() {
|
|
178
|
+
return this.rgb().formatHex8();
|
|
179
|
+
}
|
|
180
|
+
function color_formatHsl() {
|
|
181
|
+
return hslConvert(this).formatHsl();
|
|
182
|
+
}
|
|
183
|
+
function color_formatRgb() {
|
|
184
|
+
return this.rgb().formatRgb();
|
|
185
|
+
}
|
|
186
|
+
function color(format) {
|
|
187
|
+
var m, l;
|
|
188
|
+
format = (format + "").trim().toLowerCase();
|
|
189
|
+
return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) : l === 3 ? new Rgb(m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, (m & 15) << 4 | m & 15, 1) : l === 8 ? rgba(m >> 24 & 255, m >> 16 & 255, m >> 8 & 255, (m & 255) / 255) : l === 4 ? rgba(m >> 12 & 15 | m >> 8 & 240, m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, ((m & 15) << 4 | m & 15) / 255) : null) : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) : named.hasOwnProperty(format) ? rgbn(named[format]) : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
|
|
190
|
+
}
|
|
191
|
+
function rgbn(n) {
|
|
192
|
+
return new Rgb(n >> 16 & 255, n >> 8 & 255, n & 255, 1);
|
|
193
|
+
}
|
|
194
|
+
function rgba(r, g, b, a) {
|
|
195
|
+
if (a <= 0) r = g = b = NaN;
|
|
196
|
+
return new Rgb(r, g, b, a);
|
|
197
|
+
}
|
|
198
|
+
function rgbConvert(o) {
|
|
199
|
+
if (!(o instanceof Color)) o = color(o);
|
|
200
|
+
if (!o) return new Rgb();
|
|
201
|
+
o = o.rgb();
|
|
202
|
+
return new Rgb(o.r, o.g, o.b, o.opacity);
|
|
203
|
+
}
|
|
204
|
+
function rgb(r, g, b, opacity) {
|
|
205
|
+
return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
|
|
206
|
+
}
|
|
207
|
+
function Rgb(r, g, b, opacity) {
|
|
208
|
+
this.r = +r;
|
|
209
|
+
this.g = +g;
|
|
210
|
+
this.b = +b;
|
|
211
|
+
this.opacity = +opacity;
|
|
212
|
+
}
|
|
213
|
+
define.default(Rgb, rgb, define.extend(Color, {
|
|
214
|
+
brighter(k) {
|
|
215
|
+
k = k == null ? brighter : Math.pow(brighter, k);
|
|
216
|
+
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
217
|
+
},
|
|
218
|
+
darker(k) {
|
|
219
|
+
k = k == null ? darker : Math.pow(darker, k);
|
|
220
|
+
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
221
|
+
},
|
|
222
|
+
rgb() {
|
|
223
|
+
return this;
|
|
224
|
+
},
|
|
225
|
+
clamp() {
|
|
226
|
+
return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
|
|
227
|
+
},
|
|
228
|
+
displayable() {
|
|
229
|
+
return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1);
|
|
230
|
+
},
|
|
231
|
+
hex: rgb_formatHex,
|
|
232
|
+
// Deprecated! Use color.formatHex.
|
|
233
|
+
formatHex: rgb_formatHex,
|
|
234
|
+
formatHex8: rgb_formatHex8,
|
|
235
|
+
formatRgb: rgb_formatRgb,
|
|
236
|
+
toString: rgb_formatRgb
|
|
237
|
+
}));
|
|
238
|
+
function rgb_formatHex() {
|
|
239
|
+
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
|
|
240
|
+
}
|
|
241
|
+
function rgb_formatHex8() {
|
|
242
|
+
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
|
|
243
|
+
}
|
|
244
|
+
function rgb_formatRgb() {
|
|
245
|
+
const a = clampa(this.opacity);
|
|
246
|
+
return `${a === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? ")" : `, ${a})`}`;
|
|
247
|
+
}
|
|
248
|
+
function clampa(opacity) {
|
|
249
|
+
return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
|
|
250
|
+
}
|
|
251
|
+
function clampi(value) {
|
|
252
|
+
return Math.max(0, Math.min(255, Math.round(value) || 0));
|
|
253
|
+
}
|
|
254
|
+
function hex(value) {
|
|
255
|
+
value = clampi(value);
|
|
256
|
+
return (value < 16 ? "0" : "") + value.toString(16);
|
|
257
|
+
}
|
|
258
|
+
function hsla(h, s, l, a) {
|
|
259
|
+
if (a <= 0) h = s = l = NaN;
|
|
260
|
+
else if (l <= 0 || l >= 1) h = s = NaN;
|
|
261
|
+
else if (s <= 0) h = NaN;
|
|
262
|
+
return new Hsl(h, s, l, a);
|
|
263
|
+
}
|
|
264
|
+
function hslConvert(o) {
|
|
265
|
+
if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
|
|
266
|
+
if (!(o instanceof Color)) o = color(o);
|
|
267
|
+
if (!o) return new Hsl();
|
|
268
|
+
if (o instanceof Hsl) return o;
|
|
269
|
+
o = o.rgb();
|
|
270
|
+
var r = o.r / 255, g = o.g / 255, b = o.b / 255, min = Math.min(r, g, b), max = Math.max(r, g, b), h = NaN, s = max - min, l = (max + min) / 2;
|
|
271
|
+
if (s) {
|
|
272
|
+
if (r === max) h = (g - b) / s + (g < b) * 6;
|
|
273
|
+
else if (g === max) h = (b - r) / s + 2;
|
|
274
|
+
else h = (r - g) / s + 4;
|
|
275
|
+
s /= l < 0.5 ? max + min : 2 - max - min;
|
|
276
|
+
h *= 60;
|
|
277
|
+
} else {
|
|
278
|
+
s = l > 0 && l < 1 ? 0 : h;
|
|
279
|
+
}
|
|
280
|
+
return new Hsl(h, s, l, o.opacity);
|
|
281
|
+
}
|
|
282
|
+
function hsl(h, s, l, opacity) {
|
|
283
|
+
return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
|
|
284
|
+
}
|
|
285
|
+
function Hsl(h, s, l, opacity) {
|
|
286
|
+
this.h = +h;
|
|
287
|
+
this.s = +s;
|
|
288
|
+
this.l = +l;
|
|
289
|
+
this.opacity = +opacity;
|
|
290
|
+
}
|
|
291
|
+
define.default(Hsl, hsl, define.extend(Color, {
|
|
292
|
+
brighter(k) {
|
|
293
|
+
k = k == null ? brighter : Math.pow(brighter, k);
|
|
294
|
+
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
295
|
+
},
|
|
296
|
+
darker(k) {
|
|
297
|
+
k = k == null ? darker : Math.pow(darker, k);
|
|
298
|
+
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
299
|
+
},
|
|
300
|
+
rgb() {
|
|
301
|
+
var h = this.h % 360 + (this.h < 0) * 360, s = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s, m1 = 2 * l - m2;
|
|
302
|
+
return new Rgb(
|
|
303
|
+
hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
|
|
304
|
+
hsl2rgb(h, m1, m2),
|
|
305
|
+
hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
|
|
306
|
+
this.opacity
|
|
307
|
+
);
|
|
308
|
+
},
|
|
309
|
+
clamp() {
|
|
310
|
+
return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
|
|
311
|
+
},
|
|
312
|
+
displayable() {
|
|
313
|
+
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1);
|
|
314
|
+
},
|
|
315
|
+
formatHsl() {
|
|
316
|
+
const a = clampa(this.opacity);
|
|
317
|
+
return `${a === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? ")" : `, ${a})`}`;
|
|
318
|
+
}
|
|
319
|
+
}));
|
|
320
|
+
function clamph(value) {
|
|
321
|
+
value = (value || 0) % 360;
|
|
322
|
+
return value < 0 ? value + 360 : value;
|
|
323
|
+
}
|
|
324
|
+
function clampt(value) {
|
|
325
|
+
return Math.max(0, Math.min(1, value || 0));
|
|
326
|
+
}
|
|
327
|
+
function hsl2rgb(h, m1, m2) {
|
|
328
|
+
return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
|
|
329
|
+
}
|
|
330
|
+
exports.Color = Color;
|
|
331
|
+
exports.Rgb = Rgb;
|
|
332
|
+
exports.brighter = brighter;
|
|
333
|
+
exports.darker = darker;
|
|
334
|
+
exports.default = color;
|
|
335
|
+
exports.hsl = hsl;
|
|
336
|
+
exports.hslConvert = hslConvert;
|
|
337
|
+
exports.rgb = rgb;
|
|
338
|
+
exports.rgbConvert = rgbConvert;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
function define(constructor, factory, prototype) {
|
|
4
|
+
constructor.prototype = factory.prototype = prototype;
|
|
5
|
+
prototype.constructor = constructor;
|
|
6
|
+
}
|
|
7
|
+
function extend(parent, definition) {
|
|
8
|
+
var prototype = Object.create(parent.prototype);
|
|
9
|
+
for (var key in definition) prototype[key] = definition[key];
|
|
10
|
+
return prototype;
|
|
11
|
+
}
|
|
12
|
+
exports.default = define;
|
|
13
|
+
exports.extend = extend;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const pi = Math.PI, tau = 2 * pi, epsilon = 1e-6, tauEpsilon = tau - epsilon;
|
|
4
|
+
function append(strings) {
|
|
5
|
+
this._ += strings[0];
|
|
6
|
+
for (let i = 1, n = strings.length; i < n; ++i) {
|
|
7
|
+
this._ += arguments[i] + strings[i];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function appendRound(digits) {
|
|
11
|
+
let d = Math.floor(digits);
|
|
12
|
+
if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);
|
|
13
|
+
if (d > 15) return append;
|
|
14
|
+
const k = 10 ** d;
|
|
15
|
+
return function(strings) {
|
|
16
|
+
this._ += strings[0];
|
|
17
|
+
for (let i = 1, n = strings.length; i < n; ++i) {
|
|
18
|
+
this._ += Math.round(arguments[i] * k) / k + strings[i];
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
class Path {
|
|
23
|
+
constructor(digits) {
|
|
24
|
+
this._x0 = this._y0 = // start of current subpath
|
|
25
|
+
this._x1 = this._y1 = null;
|
|
26
|
+
this._ = "";
|
|
27
|
+
this._append = digits == null ? append : appendRound(digits);
|
|
28
|
+
}
|
|
29
|
+
moveTo(x, y) {
|
|
30
|
+
this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;
|
|
31
|
+
}
|
|
32
|
+
closePath() {
|
|
33
|
+
if (this._x1 !== null) {
|
|
34
|
+
this._x1 = this._x0, this._y1 = this._y0;
|
|
35
|
+
this._append`Z`;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
lineTo(x, y) {
|
|
39
|
+
this._append`L${this._x1 = +x},${this._y1 = +y}`;
|
|
40
|
+
}
|
|
41
|
+
quadraticCurveTo(x1, y1, x, y) {
|
|
42
|
+
this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;
|
|
43
|
+
}
|
|
44
|
+
bezierCurveTo(x1, y1, x2, y2, x, y) {
|
|
45
|
+
this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;
|
|
46
|
+
}
|
|
47
|
+
arcTo(x1, y1, x2, y2, r) {
|
|
48
|
+
x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
|
|
49
|
+
if (r < 0) throw new Error(`negative radius: ${r}`);
|
|
50
|
+
let x0 = this._x1, y0 = this._y1, x21 = x2 - x1, y21 = y2 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01;
|
|
51
|
+
if (this._x1 === null) {
|
|
52
|
+
this._append`M${this._x1 = x1},${this._y1 = y1}`;
|
|
53
|
+
} else if (!(l01_2 > epsilon)) ;
|
|
54
|
+
else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {
|
|
55
|
+
this._append`L${this._x1 = x1},${this._y1 = y1}`;
|
|
56
|
+
} else {
|
|
57
|
+
let x20 = x2 - x0, y20 = y2 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21;
|
|
58
|
+
if (Math.abs(t01 - 1) > epsilon) {
|
|
59
|
+
this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;
|
|
60
|
+
}
|
|
61
|
+
this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
arc(x, y, r, a0, a1, ccw) {
|
|
65
|
+
x = +x, y = +y, r = +r, ccw = !!ccw;
|
|
66
|
+
if (r < 0) throw new Error(`negative radius: ${r}`);
|
|
67
|
+
let dx = r * Math.cos(a0), dy = r * Math.sin(a0), x0 = x + dx, y0 = y + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0;
|
|
68
|
+
if (this._x1 === null) {
|
|
69
|
+
this._append`M${x0},${y0}`;
|
|
70
|
+
} else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {
|
|
71
|
+
this._append`L${x0},${y0}`;
|
|
72
|
+
}
|
|
73
|
+
if (!r) return;
|
|
74
|
+
if (da < 0) da = da % tau + tau;
|
|
75
|
+
if (da > tauEpsilon) {
|
|
76
|
+
this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;
|
|
77
|
+
} else if (da > epsilon) {
|
|
78
|
+
this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
rect(x, y, w, h) {
|
|
82
|
+
this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;
|
|
83
|
+
}
|
|
84
|
+
toString() {
|
|
85
|
+
return this._;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.Path = Path;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
function Linear(context) {
|
|
4
|
+
this._context = context;
|
|
5
|
+
}
|
|
6
|
+
Linear.prototype = {
|
|
7
|
+
areaStart: function() {
|
|
8
|
+
this._line = 0;
|
|
9
|
+
},
|
|
10
|
+
areaEnd: function() {
|
|
11
|
+
this._line = NaN;
|
|
12
|
+
},
|
|
13
|
+
lineStart: function() {
|
|
14
|
+
this._point = 0;
|
|
15
|
+
},
|
|
16
|
+
lineEnd: function() {
|
|
17
|
+
if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
|
|
18
|
+
this._line = 1 - this._line;
|
|
19
|
+
},
|
|
20
|
+
point: function(x, y) {
|
|
21
|
+
x = +x, y = +y;
|
|
22
|
+
switch (this._point) {
|
|
23
|
+
case 0:
|
|
24
|
+
this._point = 1;
|
|
25
|
+
this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
|
26
|
+
break;
|
|
27
|
+
case 1:
|
|
28
|
+
this._point = 2;
|
|
29
|
+
// falls through
|
|
30
|
+
default:
|
|
31
|
+
this._context.lineTo(x, y);
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
function curveLinear(context) {
|
|
37
|
+
return new Linear(context);
|
|
38
|
+
}
|
|
39
|
+
exports.default = curveLinear;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const array = require("./array.cjs");
|
|
4
|
+
const constant = require("./constant.cjs");
|
|
5
|
+
const linear = require("./curve/linear.cjs");
|
|
6
|
+
const path = require("./path.cjs");
|
|
7
|
+
const point = require("./point.cjs");
|
|
8
|
+
function line(x, y) {
|
|
9
|
+
var defined = constant.default(true), context = null, curve = linear.default, output = null, path$1 = path.withPath(line2);
|
|
10
|
+
x = typeof x === "function" ? x : x === void 0 ? point.x : constant.default(x);
|
|
11
|
+
y = typeof y === "function" ? y : y === void 0 ? point.y : constant.default(y);
|
|
12
|
+
function line2(data) {
|
|
13
|
+
var i, n = (data = array.default(data)).length, d, defined0 = false, buffer;
|
|
14
|
+
if (context == null) output = curve(buffer = path$1());
|
|
15
|
+
for (i = 0; i <= n; ++i) {
|
|
16
|
+
if (!(i < n && defined(d = data[i], i, data)) === defined0) {
|
|
17
|
+
if (defined0 = !defined0) output.lineStart();
|
|
18
|
+
else output.lineEnd();
|
|
19
|
+
}
|
|
20
|
+
if (defined0) output.point(+x(d, i, data), +y(d, i, data));
|
|
21
|
+
}
|
|
22
|
+
if (buffer) return output = null, buffer + "" || null;
|
|
23
|
+
}
|
|
24
|
+
line2.x = function(_) {
|
|
25
|
+
return arguments.length ? (x = typeof _ === "function" ? _ : constant.default(+_), line2) : x;
|
|
26
|
+
};
|
|
27
|
+
line2.y = function(_) {
|
|
28
|
+
return arguments.length ? (y = typeof _ === "function" ? _ : constant.default(+_), line2) : y;
|
|
29
|
+
};
|
|
30
|
+
line2.defined = function(_) {
|
|
31
|
+
return arguments.length ? (defined = typeof _ === "function" ? _ : constant.default(!!_), line2) : defined;
|
|
32
|
+
};
|
|
33
|
+
line2.curve = function(_) {
|
|
34
|
+
return arguments.length ? (curve = _, context != null && (output = curve(context)), line2) : curve;
|
|
35
|
+
};
|
|
36
|
+
line2.context = function(_) {
|
|
37
|
+
return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line2) : context;
|
|
38
|
+
};
|
|
39
|
+
return line2;
|
|
40
|
+
}
|
|
41
|
+
exports.default = line;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const path = require("../../../../d3-path@3.1.0/node_modules/d3-path/src/path.cjs");
|
|
4
|
+
function withPath(shape) {
|
|
5
|
+
let digits = 3;
|
|
6
|
+
shape.digits = function(_) {
|
|
7
|
+
if (!arguments.length) return digits;
|
|
8
|
+
if (_ == null) {
|
|
9
|
+
digits = null;
|
|
10
|
+
} else {
|
|
11
|
+
const d = Math.floor(_);
|
|
12
|
+
if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);
|
|
13
|
+
digits = d;
|
|
14
|
+
}
|
|
15
|
+
return shape;
|
|
16
|
+
};
|
|
17
|
+
return () => new path.Path(digits);
|
|
18
|
+
}
|
|
19
|
+
exports.withPath = withPath;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const reactJsxRuntime_development = require("../../../../../../_virtual/react-jsx-runtime.development.cjs");
|
|
4
|
+
const require$$0 = require("react");
|
|
5
|
+
/**
|
|
6
|
+
* @license React
|
|
7
|
+
* react-jsx-runtime.development.js
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
var hasRequiredReactJsxRuntime_development;
|
|
15
|
+
function requireReactJsxRuntime_development() {
|
|
16
|
+
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development.__exports;
|
|
17
|
+
hasRequiredReactJsxRuntime_development = 1;
|
|
18
|
+
return reactJsxRuntime_development.__exports;
|
|
19
|
+
}
|
|
20
|
+
exports.__require = requireReactJsxRuntime_development;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const reactJsxRuntime_production = require("../../../../../../_virtual/react-jsx-runtime.production.cjs");
|
|
4
|
+
/**
|
|
5
|
+
* @license React
|
|
6
|
+
* react-jsx-runtime.production.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
var hasRequiredReactJsxRuntime_production;
|
|
14
|
+
function requireReactJsxRuntime_production() {
|
|
15
|
+
if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production.__exports;
|
|
16
|
+
hasRequiredReactJsxRuntime_production = 1;
|
|
17
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
18
|
+
function jsxProd(type, config, maybeKey) {
|
|
19
|
+
var key = null;
|
|
20
|
+
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
21
|
+
void 0 !== config.key && (key = "" + config.key);
|
|
22
|
+
if ("key" in config) {
|
|
23
|
+
maybeKey = {};
|
|
24
|
+
for (var propName in config)
|
|
25
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
26
|
+
} else maybeKey = config;
|
|
27
|
+
config = maybeKey.ref;
|
|
28
|
+
return {
|
|
29
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
30
|
+
type,
|
|
31
|
+
key,
|
|
32
|
+
ref: void 0 !== config ? config : null,
|
|
33
|
+
props: maybeKey
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
reactJsxRuntime_production.__exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
37
|
+
reactJsxRuntime_production.__exports.jsx = jsxProd;
|
|
38
|
+
reactJsxRuntime_production.__exports.jsxs = jsxProd;
|
|
39
|
+
return reactJsxRuntime_production.__exports;
|
|
40
|
+
}
|
|
41
|
+
exports.__require = requireReactJsxRuntime_production;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("../../../../../_virtual/jsx-runtime2.cjs");
|
|
4
|
+
const reactJsxRuntime_production = require("./cjs/react-jsx-runtime.production.cjs");
|
|
5
|
+
const reactJsxRuntime_development = require("./cjs/react-jsx-runtime.development.cjs");
|
|
6
|
+
var hasRequiredJsxRuntime;
|
|
7
|
+
function requireJsxRuntime() {
|
|
8
|
+
if (hasRequiredJsxRuntime) return jsxRuntime.__module.exports;
|
|
9
|
+
hasRequiredJsxRuntime = 1;
|
|
10
|
+
if (true) {
|
|
11
|
+
jsxRuntime.__module.exports = reactJsxRuntime_production.__require();
|
|
12
|
+
} else {
|
|
13
|
+
jsxRuntime.__module.exports = reactJsxRuntime_development.__require();
|
|
14
|
+
}
|
|
15
|
+
return jsxRuntime.__module.exports;
|
|
16
|
+
}
|
|
17
|
+
exports.__require = requireJsxRuntime;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** 笛卡尔象限 */
|
|
2
|
+
export declare enum Quadrant {
|
|
3
|
+
TR = "top_right",// 第一象限
|
|
4
|
+
TL = "top_left",// 第二象限
|
|
5
|
+
BL = "bottom_left",// 第三象限
|
|
6
|
+
BR = "bottom_right"
|
|
7
|
+
}
|
|
8
|
+
/** 笛卡尔坐标轴 */
|
|
9
|
+
export declare enum Axis {
|
|
10
|
+
X_POS = "x-positive",// 正x轴
|
|
11
|
+
Y_POS = "y-positive",// 正y轴
|
|
12
|
+
X_NEG = "x-negative",// 负x轴
|
|
13
|
+
Y_NEG = "y-negative"
|
|
14
|
+
}
|
|
15
|
+
/** 笛卡尔坐标系位置 */
|
|
16
|
+
export type DescartesLocation = Quadrant | Axis | 'center';
|
|
17
|
+
/** 笛卡尔坐标 */
|
|
18
|
+
export type Position = [number, number];
|
|
19
|
+
/** 笛卡尔坐标(对象形式) */
|
|
20
|
+
export type DescartesPosition = {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
};
|