inline-style-editor 1.3.2 → 1.3.4
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/README.md +1 -1
- package/dist/inline-style-editor.js +2 -2
- package/dist/inline-style-editor.js.map +1 -1
- package/dist/inline-style-editor.mjs +80 -100
- package/dist/inline-style-editor.mjs.map +1 -1
- package/docs/index.html +2 -2
- package/package.json +1 -1
- package/src/components/InlineStyleEditor.svelte +4 -2
- package/src/util/fonts.js +57 -75
- package/stats.html +1 -19
- package/test.html +4 -4
package/docs/index.html
CHANGED
|
@@ -333,11 +333,11 @@
|
|
|
333
333
|
<script>
|
|
334
334
|
const editor = new InlineStyleEditor(
|
|
335
335
|
{
|
|
336
|
-
|
|
336
|
+
getElems: (el) => {
|
|
337
337
|
if (el.classList.contains('adm1')) {
|
|
338
338
|
const parentCountry = el.parentNode.getAttribute('id').replace('-adm1', '');
|
|
339
339
|
const countryElem = document.getElementById(parentCountry);
|
|
340
|
-
return [[countryElem, 'Italia']];
|
|
340
|
+
return [[el, 'Clicked'], [countryElem, 'Italia']];
|
|
341
341
|
}
|
|
342
342
|
return [];
|
|
343
343
|
},
|
package/package.json
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
export let
|
|
33
|
+
export let getElems = null;
|
|
34
34
|
export let listenOnClick = false;
|
|
35
35
|
export let onStyleChanged = () => {};
|
|
36
36
|
export let customProps = {};
|
|
@@ -232,7 +232,9 @@
|
|
|
232
232
|
bringableToFront = [];
|
|
233
233
|
allTypes = [];
|
|
234
234
|
allRules = [];
|
|
235
|
-
|
|
235
|
+
console.log(getElems, getElems(el));
|
|
236
|
+
if (getElems) targetsToSearch = getElems(el);
|
|
237
|
+
else targetsToSearch = [[el, 'Clicked']];
|
|
236
238
|
allTypes = getEditableTypes(targetsToSearch);
|
|
237
239
|
hasDisplayedCustom = false;
|
|
238
240
|
allRules = getMatchedCSSRules(targetsToSearch);
|
package/src/util/fonts.js
CHANGED
|
@@ -1,15 +1,63 @@
|
|
|
1
|
-
|
|
1
|
+
// https://stackoverflow.com/a/3368855
|
|
2
|
+
function getAvailableFonts() {
|
|
3
|
+
const fontsToCheck = new Set([
|
|
4
|
+
'Arial', 'Arial Black', 'Bahnschrift', 'Calibri', 'Cambria', 'Cambria Math', 'Candara', 'Comic Sans MS', 'Consolas', 'Constantia', 'Corbel', 'Courier New', 'Ebrima', 'Franklin Gothic Medium', 'Gabriola', 'Gadugi', 'Georgia', 'HoloLens MDL2 Assets', 'Impact', 'Ink Free', 'Javanese Text', 'Leelawadee UI', 'Lucida Console', 'Lucida Sans Unicode', 'Malgun Gothic', 'Marlett', 'Microsoft Himalaya', 'Microsoft JhengHei', 'Microsoft New Tai Lue', 'Microsoft PhagsPa', 'Microsoft Sans Serif', 'Microsoft Tai Le', 'Microsoft YaHei', 'Microsoft Yi Baiti', 'MingLiU-ExtB', 'Mongolian Baiti', 'MS Gothic', 'MV Boli', 'Myanmar Text', 'Nirmala UI', 'Palatino Linotype', 'Segoe MDL2 Assets', 'Segoe Print', 'Segoe Script', 'Segoe UI', 'Segoe UI Historic', 'Segoe UI Emoji', 'Segoe UI Symbol', 'SimSun', 'Sitka', 'Sylfaen', 'Symbol', 'Tahoma', 'Times New Roman', 'Trebuchet MS', 'Verdana', 'Webdings', 'Wingdings', 'Yu Gothic',
|
|
5
|
+
'American Typewriter', 'Andale Mono', 'Arial', 'Arial Black', 'Arial Narrow', 'Arial Rounded MT Bold', 'Arial Unicode MS', 'Avenir', 'Avenir Next', 'Avenir Next Condensed', 'Baskerville', 'Big Caslon', 'Bodoni 72', 'Bodoni 72 Oldstyle', 'Bodoni 72 Smallcaps', 'Bradley Hand', 'Brush Script MT', 'Chalkboard', 'Chalkboard SE', 'Chalkduster', 'Charter', 'Cochin', 'Comic Sans MS', 'Copperplate', 'Courier', 'Courier New', 'Didot', 'DIN Alternate', 'DIN Condensed', 'Futura', 'Geneva', 'Georgia', 'Gill Sans', 'Helvetica', 'Helvetica Neue', 'Herculanum', 'Hoefler Text', 'Impact', 'Lucida Grande', 'Luminari', 'Marker Felt', 'Menlo', 'Microsoft Sans Serif', 'Monaco', 'Noteworthy', 'Optima', 'Palatino', 'Papyrus', 'Phosphate', 'Rockwell', 'Savoye LET', 'SignPainter', 'Skia', 'Snell Roundhand', 'Tahoma', 'Times', 'Times New Roman', 'Trattatello', 'Trebuchet MS', 'Verdana', 'Zapfino',
|
|
6
|
+
'Comic Sans MS', 'Comic Sans', 'Apple Chancery', 'Bradley Hand', 'Brush Script MT', 'Brush Script Std', 'Snell Roundhand', 'URW Chancery L'
|
|
7
|
+
].sort());
|
|
8
|
+
const defaultWidth = {};
|
|
9
|
+
const defaultHeight = {};
|
|
10
|
+
// a font will be compared against all the three default fonts.
|
|
11
|
+
// and if it doesn't match all 3 then that font is not available.
|
|
12
|
+
const baseFonts = ['monospace', 'sans-serif', 'serif', 'cursive'];
|
|
2
13
|
|
|
3
|
-
|
|
4
|
-
//
|
|
14
|
+
// we use m or w because these two characters take up the maximum width.
|
|
15
|
+
// And we use a LLi so that the same matching fonts can get separated
|
|
16
|
+
const testString = "mmmmmmmmmmlli";
|
|
17
|
+
|
|
18
|
+
// we test using 72px font size, we may use any size. I guess larger the better.
|
|
19
|
+
const testSize = '72px';
|
|
20
|
+
|
|
21
|
+
const container = document.getElementsByTagName("body")[0];
|
|
5
22
|
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
23
|
+
// create a SPAN in the document to get the width of the text we use to test
|
|
24
|
+
const spanTester = document.createElement("span");
|
|
25
|
+
spanTester.style.fontSize = testSize;
|
|
26
|
+
spanTester.innerHTML = testString;
|
|
27
|
+
baseFonts.forEach(font => {
|
|
28
|
+
//get the default width for the three base fonts
|
|
29
|
+
spanTester.style.fontFamily = font;
|
|
30
|
+
container.appendChild(spanTester);
|
|
31
|
+
defaultWidth[font] = spanTester.offsetWidth; // width for the default font
|
|
32
|
+
defaultHeight[font] = spanTester.offsetHeight; // height for the default font
|
|
33
|
+
container.removeChild(spanTester);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const availableFonts = [];
|
|
37
|
+
|
|
38
|
+
const fontExists = (fontName) => {
|
|
39
|
+
let detected = false;
|
|
40
|
+
for (const font of baseFonts) {
|
|
41
|
+
spanTester.style.fontFamily = fontName + ',' + font; // name of the font along with the base font for fallback.
|
|
42
|
+
container.appendChild(spanTester);
|
|
43
|
+
const matched = (spanTester.offsetWidth != defaultWidth[font] || spanTester.offsetHeight != defaultHeight[font]);
|
|
44
|
+
container.removeChild(spanTester);
|
|
45
|
+
detected = detected || matched;
|
|
46
|
+
}
|
|
47
|
+
return detected;
|
|
48
|
+
}
|
|
49
|
+
for (const font of fontsToCheck.values()) {
|
|
50
|
+
if (fontExists(font)) {
|
|
51
|
+
availableFonts.push(font);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return availableFonts.sort();
|
|
55
|
+
|
|
56
|
+
}
|
|
11
57
|
|
|
12
|
-
|
|
58
|
+
const availableFonts = getAvailableFonts();
|
|
59
|
+
function getFonts() {
|
|
60
|
+
return [...listFonts(), ...availableFonts]
|
|
13
61
|
}
|
|
14
62
|
|
|
15
63
|
function listFonts() {
|
|
@@ -32,71 +80,5 @@ function listFonts() {
|
|
|
32
80
|
return [...new Set(arr)];
|
|
33
81
|
}
|
|
34
82
|
|
|
35
|
-
// https://stackoverflow.com/a/3368855
|
|
36
|
-
class FontDetector {
|
|
37
|
-
constructor() {
|
|
38
|
-
this.fontsToCheck = new Set([
|
|
39
|
-
'Arial', 'Arial Black', 'Bahnschrift', 'Calibri', 'Cambria', 'Cambria Math', 'Candara', 'Comic Sans MS', 'Consolas', 'Constantia', 'Corbel', 'Courier New', 'Ebrima', 'Franklin Gothic Medium', 'Gabriola', 'Gadugi', 'Georgia', 'HoloLens MDL2 Assets', 'Impact', 'Ink Free', 'Javanese Text', 'Leelawadee UI', 'Lucida Console', 'Lucida Sans Unicode', 'Malgun Gothic', 'Marlett', 'Microsoft Himalaya', 'Microsoft JhengHei', 'Microsoft New Tai Lue', 'Microsoft PhagsPa', 'Microsoft Sans Serif', 'Microsoft Tai Le', 'Microsoft YaHei', 'Microsoft Yi Baiti', 'MingLiU-ExtB', 'Mongolian Baiti', 'MS Gothic', 'MV Boli', 'Myanmar Text', 'Nirmala UI', 'Palatino Linotype', 'Segoe MDL2 Assets', 'Segoe Print', 'Segoe Script', 'Segoe UI', 'Segoe UI Historic', 'Segoe UI Emoji', 'Segoe UI Symbol', 'SimSun', 'Sitka', 'Sylfaen', 'Symbol', 'Tahoma', 'Times New Roman', 'Trebuchet MS', 'Verdana', 'Webdings', 'Wingdings', 'Yu Gothic',
|
|
40
|
-
'American Typewriter', 'Andale Mono', 'Arial', 'Arial Black', 'Arial Narrow', 'Arial Rounded MT Bold', 'Arial Unicode MS', 'Avenir', 'Avenir Next', 'Avenir Next Condensed', 'Baskerville', 'Big Caslon', 'Bodoni 72', 'Bodoni 72 Oldstyle', 'Bodoni 72 Smallcaps', 'Bradley Hand', 'Brush Script MT', 'Chalkboard', 'Chalkboard SE', 'Chalkduster', 'Charter', 'Cochin', 'Comic Sans MS', 'Copperplate', 'Courier', 'Courier New', 'Didot', 'DIN Alternate', 'DIN Condensed', 'Futura', 'Geneva', 'Georgia', 'Gill Sans', 'Helvetica', 'Helvetica Neue', 'Herculanum', 'Hoefler Text', 'Impact', 'Lucida Grande', 'Luminari', 'Marker Felt', 'Menlo', 'Microsoft Sans Serif', 'Monaco', 'Noteworthy', 'Optima', 'Palatino', 'Papyrus', 'Phosphate', 'Rockwell', 'Savoye LET', 'SignPainter', 'Skia', 'Snell Roundhand', 'Tahoma', 'Times', 'Times New Roman', 'Trattatello', 'Trebuchet MS', 'Verdana', 'Zapfino',
|
|
41
|
-
'Comic Sans MS', 'Comic Sans', 'Apple Chancery', 'Bradley Hand', 'Brush Script MT', 'Brush Script Std', 'Snell Roundhand', 'URW Chancery L'
|
|
42
|
-
].sort());
|
|
43
|
-
this.init();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
init() {
|
|
47
|
-
this.defaultWidth = {};
|
|
48
|
-
this.defaultHeight = {};
|
|
49
|
-
// a font will be compared against all the three default fonts.
|
|
50
|
-
// and if it doesn't match all 3 then that font is not available.
|
|
51
|
-
this.baseFonts = ['monospace', 'sans-serif', 'serif', 'cursive'];
|
|
52
|
-
|
|
53
|
-
// we use m or w because these two characters take up the maximum width.
|
|
54
|
-
// And we use a LLi so that the same matching fonts can get separated
|
|
55
|
-
const testString = "mmmmmmmmmmlli";
|
|
56
|
-
|
|
57
|
-
// we test using 72px font size, we may use any size. I guess larger the better.
|
|
58
|
-
const testSize = '72px';
|
|
59
|
-
|
|
60
|
-
this.container = document.getElementsByTagName("body")[0];
|
|
61
|
-
|
|
62
|
-
// create a SPAN in the document to get the width of the text we use to test
|
|
63
|
-
this.spanTester = document.createElement("span");
|
|
64
|
-
this.spanTester.style.fontSize = testSize;
|
|
65
|
-
this.spanTester.innerHTML = testString;
|
|
66
|
-
this.baseFonts.forEach(font => {
|
|
67
|
-
//get the default width for the three base fonts
|
|
68
|
-
this.spanTester.style.fontFamily = font;
|
|
69
|
-
this.container.appendChild(this.spanTester);
|
|
70
|
-
this.defaultWidth[font] = this.spanTester.offsetWidth; // width for the default font
|
|
71
|
-
this.defaultHeight[font] = this.spanTester.offsetHeight; // height for the default font
|
|
72
|
-
this.container.removeChild(this.spanTester);
|
|
73
|
-
});
|
|
74
|
-
this.detectFonts();
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
fontExists(fontName) {
|
|
78
|
-
let detected = false;
|
|
79
|
-
for (const font of this.baseFonts) {
|
|
80
|
-
this.spanTester.style.fontFamily = fontName + ',' + font; // name of the font along with the base font for fallback.
|
|
81
|
-
this.container.appendChild(this.spanTester);
|
|
82
|
-
const matched = (this.spanTester.offsetWidth != this.defaultWidth[font] || this.spanTester.offsetHeight != this.defaultHeight[font]);
|
|
83
|
-
this.container.removeChild(this.spanTester);
|
|
84
|
-
detected = detected || matched;
|
|
85
|
-
}
|
|
86
|
-
return detected;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
detectFonts() {
|
|
90
|
-
this.availableFonts = [];
|
|
91
|
-
for (const font of this.fontsToCheck.values()) {
|
|
92
|
-
if (this.fontExists(font)) {
|
|
93
|
-
this.availableFonts.push(font);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
this.availableFonts.sort();
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
};
|
|
100
|
-
|
|
101
83
|
|
|
102
84
|
export { getFonts };
|
package/stats.html
CHANGED
|
@@ -4014,25 +4014,7 @@ var drawChart = (function (exports) {
|
|
|
4014
4014
|
</script>
|
|
4015
4015
|
<script>
|
|
4016
4016
|
/*<!--*/
|
|
4017
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"inline-style-editor.mjs","children":[{"name":"node_modules","children":[{"name":"svelte/internal/index.mjs","uid":"d028-1"},{"name":"d3-array/src","children":[{"uid":"d028-5","name":"ascending.js"},{"uid":"d028-7","name":"descending.js"},{"uid":"d028-9","name":"bisector.js"},{"uid":"d028-11","name":"number.js"},{"uid":"d028-13","name":"bisect.js"},{"uid":"d028-15","name":"count.js"},{"uid":"d028-17","name":"extent.js"},{"uid":"d028-19","name":"ticks.js"},{"name":"threshold/sturges.js","uid":"d028-21"}]},{"name":"d3-contour/src","children":[{"uid":"d028-23","name":"array.js"},{"uid":"d028-25","name":"ascending.js"},{"uid":"d028-27","name":"area.js"},{"uid":"d028-29","name":"constant.js"},{"uid":"d028-31","name":"contains.js"},{"uid":"d028-33","name":"noop.js"},{"uid":"d028-35","name":"contours.js"}]},{"name":"vanilla-picker/dist/vanilla-picker.csp.mjs","uid":"d028-39"}]},{"name":"src","children":[{"name":"util","children":[{"uid":"d028-3","name":"util.js"},{"uid":"d028-37","name":"boxesContour.js"},{"uid":"d028-43","name":"fonts.js"}]},{"name":"components","children":[{"uid":"d028-41","name":"ColorPicker.svelte"},{"uid":"d028-45","name":"InlineStyleEditor.svelte"}]},{"uid":"d028-47","name":"index.js"}]}]}],"isRoot":true},"nodeParts":{"d028-1":{"renderedLength":11004,"gzipLength":0,"brotliLength":0,"mainUid":"d028-0"},"d028-3":{"renderedLength":594,"gzipLength":0,"brotliLength":0,"mainUid":"d028-2"},"d028-5":{"renderedLength":113,"gzipLength":0,"brotliLength":0,"mainUid":"d028-4"},"d028-7":{"renderedLength":128,"gzipLength":0,"brotliLength":0,"mainUid":"d028-6"},"d028-9":{"renderedLength":1476,"gzipLength":0,"brotliLength":0,"mainUid":"d028-8"},"d028-11":{"renderedLength":54,"gzipLength":0,"brotliLength":0,"mainUid":"d028-10"},"d028-13":{"renderedLength":47,"gzipLength":0,"brotliLength":0,"mainUid":"d028-12"},"d028-15":{"renderedLength":408,"gzipLength":0,"brotliLength":0,"mainUid":"d028-14"},"d028-17":{"renderedLength":707,"gzipLength":0,"brotliLength":0,"mainUid":"d028-16"},"d028-19":{"renderedLength":1713,"gzipLength":0,"brotliLength":0,"mainUid":"d028-18"},"d028-21":{"renderedLength":97,"gzipLength":0,"brotliLength":0,"mainUid":"d028-20"},"d028-23":{"renderedLength":54,"gzipLength":0,"brotliLength":0,"mainUid":"d028-22"},"d028-25":{"renderedLength":44,"gzipLength":0,"brotliLength":0,"mainUid":"d028-24"},"d028-27":{"renderedLength":219,"gzipLength":0,"brotliLength":0,"mainUid":"d028-26"},"d028-29":{"renderedLength":28,"gzipLength":0,"brotliLength":0,"mainUid":"d028-28"},"d028-31":{"renderedLength":864,"gzipLength":0,"brotliLength":0,"mainUid":"d028-30"},"d028-33":{"renderedLength":18,"gzipLength":0,"brotliLength":0,"mainUid":"d028-32"},"d028-35":{"renderedLength":5884,"gzipLength":0,"brotliLength":0,"mainUid":"d028-34"},"d028-37":{"renderedLength":3328,"gzipLength":0,"brotliLength":0,"mainUid":"d028-36"},"d028-39":{"renderedLength":31283,"gzipLength":0,"brotliLength":0,"mainUid":"d028-38"},"d028-41":{"renderedLength":2125,"gzipLength":0,"brotliLength":0,"mainUid":"d028-40"},"d028-43":{"renderedLength":5191,"gzipLength":0,"brotliLength":0,"mainUid":"d028-42"},"d028-45":{"renderedLength":51338,"gzipLength":0,"brotliLength":0,"mainUid":"d028-44"},"d028-47":{"renderedLength":133,"gzipLength":0,"brotliLength":0,"mainUid":"d028-46"}},"nodeMetas":{"d028-0":{"id":"/node_modules/svelte/internal/index.mjs","moduleParts":{"inline-style-editor.mjs":"d028-1"},"imported":[],"importedBy":[{"uid":"d028-44"},{"uid":"d028-48"},{"uid":"d028-40"}]},"d028-2":{"id":"/src/util/util.js","moduleParts":{"inline-style-editor.mjs":"d028-3"},"imported":[],"importedBy":[{"uid":"d028-44"}]},"d028-4":{"id":"/node_modules/d3-array/src/ascending.js","moduleParts":{"inline-style-editor.mjs":"d028-5"},"imported":[],"importedBy":[{"uid":"d028-52"},{"uid":"d028-12"},{"uid":"d028-8"},{"uid":"d028-59"},{"uid":"d028-77"},{"uid":"d028-78"},{"uid":"d028-79"},{"uid":"d028-80"},{"uid":"d028-81"},{"uid":"d028-94"}]},"d028-6":{"id":"/node_modules/d3-array/src/descending.js","moduleParts":{"inline-style-editor.mjs":"d028-7"},"imported":[],"importedBy":[{"uid":"d028-52"},{"uid":"d028-8"}]},"d028-8":{"id":"/node_modules/d3-array/src/bisector.js","moduleParts":{"inline-style-editor.mjs":"d028-9"},"imported":[{"uid":"d028-4"},{"uid":"d028-6"}],"importedBy":[{"uid":"d028-52"},{"uid":"d028-12"}]},"d028-10":{"id":"/node_modules/d3-array/src/number.js","moduleParts":{"inline-style-editor.mjs":"d028-11"},"imported":[],"importedBy":[{"uid":"d028-12"},{"uid":"d028-74"}]},"d028-12":{"id":"/node_modules/d3-array/src/bisect.js","moduleParts":{"inline-style-editor.mjs":"d028-13"},"imported":[{"uid":"d028-4"},{"uid":"d028-8"},{"uid":"d028-10"}],"importedBy":[{"uid":"d028-52"},{"uid":"d028-60"}]},"d028-14":{"id":"/node_modules/d3-array/src/count.js","moduleParts":{"inline-style-editor.mjs":"d028-15"},"imported":[],"importedBy":[{"uid":"d028-52"},{"uid":"d028-61"},{"uid":"d028-62"},{"uid":"d028-20"}]},"d028-16":{"id":"/node_modules/d3-array/src/extent.js","moduleParts":{"inline-style-editor.mjs":"d028-17"},"imported":[],"importedBy":[{"uid":"d028-52"},{"uid":"d028-60"}]},"d028-18":{"id":"/node_modules/d3-array/src/ticks.js","moduleParts":{"inline-style-editor.mjs":"d028-19"},"imported":[],"importedBy":[{"uid":"d028-52"},{"uid":"d028-60"},{"uid":"d028-71"}]},"d028-20":{"id":"/node_modules/d3-array/src/threshold/sturges.js","moduleParts":{"inline-style-editor.mjs":"d028-21"},"imported":[{"uid":"d028-14"}],"importedBy":[{"uid":"d028-52"},{"uid":"d028-60"}]},"d028-22":{"id":"/node_modules/d3-contour/src/array.js","moduleParts":{"inline-style-editor.mjs":"d028-23"},"imported":[],"importedBy":[{"uid":"d028-34"},{"uid":"d028-51"}]},"d028-24":{"id":"/node_modules/d3-contour/src/ascending.js","moduleParts":{"inline-style-editor.mjs":"d028-25"},"imported":[],"importedBy":[{"uid":"d028-34"}]},"d028-26":{"id":"/node_modules/d3-contour/src/area.js","moduleParts":{"inline-style-editor.mjs":"d028-27"},"imported":[],"importedBy":[{"uid":"d028-34"}]},"d028-28":{"id":"/node_modules/d3-contour/src/constant.js","moduleParts":{"inline-style-editor.mjs":"d028-29"},"imported":[],"importedBy":[{"uid":"d028-34"},{"uid":"d028-51"}]},"d028-30":{"id":"/node_modules/d3-contour/src/contains.js","moduleParts":{"inline-style-editor.mjs":"d028-31"},"imported":[],"importedBy":[{"uid":"d028-34"}]},"d028-32":{"id":"/node_modules/d3-contour/src/noop.js","moduleParts":{"inline-style-editor.mjs":"d028-33"},"imported":[],"importedBy":[{"uid":"d028-34"}]},"d028-34":{"id":"/node_modules/d3-contour/src/contours.js","moduleParts":{"inline-style-editor.mjs":"d028-35"},"imported":[{"uid":"d028-52"},{"uid":"d028-22"},{"uid":"d028-24"},{"uid":"d028-26"},{"uid":"d028-28"},{"uid":"d028-30"},{"uid":"d028-32"}],"importedBy":[{"uid":"d028-50"},{"uid":"d028-51"}]},"d028-36":{"id":"/src/util/boxesContour.js","moduleParts":{"inline-style-editor.mjs":"d028-37"},"imported":[{"uid":"d028-50"}],"importedBy":[{"uid":"d028-44"}]},"d028-38":{"id":"/node_modules/vanilla-picker/dist/vanilla-picker.csp.mjs","moduleParts":{"inline-style-editor.mjs":"d028-39"},"imported":[],"importedBy":[{"uid":"d028-40"}]},"d028-40":{"id":"/src/components/ColorPicker.svelte","moduleParts":{"inline-style-editor.mjs":"d028-41"},"imported":[{"uid":"d028-0"},{"uid":"d028-38"},{"uid":"d028-48"}],"importedBy":[{"uid":"d028-44"}]},"d028-42":{"id":"/src/util/fonts.js","moduleParts":{"inline-style-editor.mjs":"d028-43"},"imported":[],"importedBy":[{"uid":"d028-44"}]},"d028-44":{"id":"/src/components/InlineStyleEditor.svelte","moduleParts":{"inline-style-editor.mjs":"d028-45"},"imported":[{"uid":"d028-0"},{"uid":"d028-48"},{"uid":"d028-49"},{"uid":"d028-2"},{"uid":"d028-36"},{"uid":"d028-40"},{"uid":"d028-42"}],"importedBy":[{"uid":"d028-46"}]},"d028-46":{"id":"/src/index.js","moduleParts":{"inline-style-editor.mjs":"d028-47"},"imported":[{"uid":"d028-44"}],"importedBy":[],"isEntry":true},"d028-48":{"id":"/node_modules/svelte/index.mjs","moduleParts":{},"imported":[{"uid":"d028-0"}],"importedBy":[{"uid":"d028-44"},{"uid":"d028-40"}]},"d028-49":{"id":"/src/assets/index.scss","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-44"}]},"d028-50":{"id":"/node_modules/d3-contour/src/index.js","moduleParts":{},"imported":[{"uid":"d028-34"},{"uid":"d028-51"}],"importedBy":[{"uid":"d028-36"}]},"d028-51":{"id":"/node_modules/d3-contour/src/density.js","moduleParts":{},"imported":[{"uid":"d028-52"},{"uid":"d028-22"},{"uid":"d028-28"},{"uid":"d028-34"}],"importedBy":[{"uid":"d028-50"}]},"d028-52":{"id":"/node_modules/d3-array/src/index.js","moduleParts":{},"imported":[{"uid":"d028-12"},{"uid":"d028-4"},{"uid":"d028-8"},{"uid":"d028-53"},{"uid":"d028-14"},{"uid":"d028-54"},{"uid":"d028-55"},{"uid":"d028-6"},{"uid":"d028-56"},{"uid":"d028-16"},{"uid":"d028-57"},{"uid":"d028-58"},{"uid":"d028-59"},{"uid":"d028-60"},{"uid":"d028-61"},{"uid":"d028-62"},{"uid":"d028-20"},{"uid":"d028-63"},{"uid":"d028-64"},{"uid":"d028-65"},{"uid":"d028-66"},{"uid":"d028-67"},{"uid":"d028-68"},{"uid":"d028-69"},{"uid":"d028-70"},{"uid":"d028-71"},{"uid":"d028-72"},{"uid":"d028-73"},{"uid":"d028-74"},{"uid":"d028-75"},{"uid":"d028-76"},{"uid":"d028-77"},{"uid":"d028-78"},{"uid":"d028-79"},{"uid":"d028-80"},{"uid":"d028-81"},{"uid":"d028-82"},{"uid":"d028-83"},{"uid":"d028-84"},{"uid":"d028-18"},{"uid":"d028-85"},{"uid":"d028-86"},{"uid":"d028-87"},{"uid":"d028-88"},{"uid":"d028-89"},{"uid":"d028-90"},{"uid":"d028-91"},{"uid":"d028-92"},{"uid":"d028-93"},{"uid":"d028-94"},{"uid":"d028-95"},{"uid":"d028-96"},{"uid":"d028-97"},{"uid":"d028-98"},{"uid":"d028-99"},{"uid":"d028-100"},{"uid":"d028-101"}],"importedBy":[{"uid":"d028-34"},{"uid":"d028-51"}]},"d028-53":{"id":"/node_modules/d3-array/src/blur.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"}]},"d028-54":{"id":"/node_modules/d3-array/src/cross.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"}]},"d028-55":{"id":"/node_modules/d3-array/src/cumsum.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"}]},"d028-56":{"id":"/node_modules/d3-array/src/deviation.js","moduleParts":{},"imported":[{"uid":"d028-86"}],"importedBy":[{"uid":"d028-52"},{"uid":"d028-62"}]},"d028-57":{"id":"/node_modules/d3-array/src/fsum.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"}]},"d028-58":{"id":"/node_modules/d3-array/src/group.js","moduleParts":{},"imported":[{"uid":"d028-101"},{"uid":"d028-102"}],"importedBy":[{"uid":"d028-52"},{"uid":"d028-59"}]},"d028-59":{"id":"/node_modules/d3-array/src/groupSort.js","moduleParts":{},"imported":[{"uid":"d028-4"},{"uid":"d028-58"},{"uid":"d028-94"}],"importedBy":[{"uid":"d028-52"}]},"d028-60":{"id":"/node_modules/d3-array/src/bin.js","moduleParts":{},"imported":[{"uid":"d028-103"},{"uid":"d028-12"},{"uid":"d028-104"},{"uid":"d028-16"},{"uid":"d028-102"},{"uid":"d028-71"},{"uid":"d028-18"},{"uid":"d028-20"}],"importedBy":[{"uid":"d028-52"}]},"d028-61":{"id":"/node_modules/d3-array/src/threshold/freedmanDiaconis.js","moduleParts":{},"imported":[{"uid":"d028-14"},{"uid":"d028-74"}],"importedBy":[{"uid":"d028-52"}]},"d028-62":{"id":"/node_modules/d3-array/src/threshold/scott.js","moduleParts":{},"imported":[{"uid":"d028-14"},{"uid":"d028-56"}],"importedBy":[{"uid":"d028-52"}]},"d028-63":{"id":"/node_modules/d3-array/src/max.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"},{"uid":"d028-74"}]},"d028-64":{"id":"/node_modules/d3-array/src/maxIndex.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"},{"uid":"d028-74"},{"uid":"d028-81"}]},"d028-65":{"id":"/node_modules/d3-array/src/mean.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"}]},"d028-66":{"id":"/node_modules/d3-array/src/median.js","moduleParts":{},"imported":[{"uid":"d028-74"}],"importedBy":[{"uid":"d028-52"}]},"d028-67":{"id":"/node_modules/d3-array/src/merge.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"}]},"d028-68":{"id":"/node_modules/d3-array/src/min.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"},{"uid":"d028-74"},{"uid":"d028-85"}]},"d028-69":{"id":"/node_modules/d3-array/src/minIndex.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"},{"uid":"d028-74"},{"uid":"d028-79"}]},"d028-70":{"id":"/node_modules/d3-array/src/mode.js","moduleParts":{},"imported":[{"uid":"d028-101"}],"importedBy":[{"uid":"d028-52"}]},"d028-71":{"id":"/node_modules/d3-array/src/nice.js","moduleParts":{},"imported":[{"uid":"d028-18"}],"importedBy":[{"uid":"d028-52"},{"uid":"d028-60"}]},"d028-72":{"id":"/node_modules/d3-array/src/pairs.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"}]},"d028-73":{"id":"/node_modules/d3-array/src/permute.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"},{"uid":"d028-94"}]},"d028-74":{"id":"/node_modules/d3-array/src/quantile.js","moduleParts":{},"imported":[{"uid":"d028-63"},{"uid":"d028-64"},{"uid":"d028-68"},{"uid":"d028-69"},{"uid":"d028-75"},{"uid":"d028-10"},{"uid":"d028-94"},{"uid":"d028-80"}],"importedBy":[{"uid":"d028-52"},{"uid":"d028-61"},{"uid":"d028-66"}]},"d028-75":{"id":"/node_modules/d3-array/src/quickselect.js","moduleParts":{},"imported":[{"uid":"d028-94"}],"importedBy":[{"uid":"d028-52"},{"uid":"d028-74"}]},"d028-76":{"id":"/node_modules/d3-array/src/range.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"}]},"d028-77":{"id":"/node_modules/d3-array/src/rank.js","moduleParts":{},"imported":[{"uid":"d028-4"},{"uid":"d028-94"}],"importedBy":[{"uid":"d028-52"}]},"d028-78":{"id":"/node_modules/d3-array/src/least.js","moduleParts":{},"imported":[{"uid":"d028-4"}],"importedBy":[{"uid":"d028-52"}]},"d028-79":{"id":"/node_modules/d3-array/src/leastIndex.js","moduleParts":{},"imported":[{"uid":"d028-4"},{"uid":"d028-69"}],"importedBy":[{"uid":"d028-52"},{"uid":"d028-82"}]},"d028-80":{"id":"/node_modules/d3-array/src/greatest.js","moduleParts":{},"imported":[{"uid":"d028-4"}],"importedBy":[{"uid":"d028-52"},{"uid":"d028-74"}]},"d028-81":{"id":"/node_modules/d3-array/src/greatestIndex.js","moduleParts":{},"imported":[{"uid":"d028-4"},{"uid":"d028-64"}],"importedBy":[{"uid":"d028-52"}]},"d028-82":{"id":"/node_modules/d3-array/src/scan.js","moduleParts":{},"imported":[{"uid":"d028-79"}],"importedBy":[{"uid":"d028-52"}]},"d028-83":{"id":"/node_modules/d3-array/src/shuffle.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"}]},"d028-84":{"id":"/node_modules/d3-array/src/sum.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"}]},"d028-85":{"id":"/node_modules/d3-array/src/transpose.js","moduleParts":{},"imported":[{"uid":"d028-68"}],"importedBy":[{"uid":"d028-52"},{"uid":"d028-87"}]},"d028-86":{"id":"/node_modules/d3-array/src/variance.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"},{"uid":"d028-56"}]},"d028-87":{"id":"/node_modules/d3-array/src/zip.js","moduleParts":{},"imported":[{"uid":"d028-85"}],"importedBy":[{"uid":"d028-52"}]},"d028-88":{"id":"/node_modules/d3-array/src/every.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"}]},"d028-89":{"id":"/node_modules/d3-array/src/some.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"}]},"d028-90":{"id":"/node_modules/d3-array/src/filter.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"}]},"d028-91":{"id":"/node_modules/d3-array/src/map.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"}]},"d028-92":{"id":"/node_modules/d3-array/src/reduce.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"}]},"d028-93":{"id":"/node_modules/d3-array/src/reverse.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"}]},"d028-94":{"id":"/node_modules/d3-array/src/sort.js","moduleParts":{},"imported":[{"uid":"d028-4"},{"uid":"d028-73"}],"importedBy":[{"uid":"d028-52"},{"uid":"d028-59"},{"uid":"d028-74"},{"uid":"d028-75"},{"uid":"d028-77"}]},"d028-95":{"id":"/node_modules/d3-array/src/difference.js","moduleParts":{},"imported":[{"uid":"d028-101"}],"importedBy":[{"uid":"d028-52"}]},"d028-96":{"id":"/node_modules/d3-array/src/disjoint.js","moduleParts":{},"imported":[{"uid":"d028-101"}],"importedBy":[{"uid":"d028-52"}]},"d028-97":{"id":"/node_modules/d3-array/src/intersection.js","moduleParts":{},"imported":[{"uid":"d028-101"}],"importedBy":[{"uid":"d028-52"}]},"d028-98":{"id":"/node_modules/d3-array/src/subset.js","moduleParts":{},"imported":[{"uid":"d028-99"}],"importedBy":[{"uid":"d028-52"}]},"d028-99":{"id":"/node_modules/d3-array/src/superset.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"},{"uid":"d028-98"}]},"d028-100":{"id":"/node_modules/d3-array/src/union.js","moduleParts":{},"imported":[{"uid":"d028-101"}],"importedBy":[{"uid":"d028-52"}]},"d028-101":{"id":"/node_modules/internmap/src/index.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-52"},{"uid":"d028-58"},{"uid":"d028-70"},{"uid":"d028-95"},{"uid":"d028-96"},{"uid":"d028-97"},{"uid":"d028-100"}]},"d028-102":{"id":"/node_modules/d3-array/src/identity.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-58"},{"uid":"d028-60"}]},"d028-103":{"id":"/node_modules/d3-array/src/array.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-60"}]},"d028-104":{"id":"/node_modules/d3-array/src/constant.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"d028-60"}]}},"env":{"rollup":"2.78.1"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
|
|
4018
|
-
|
|
4019
|
-
const run = () => {
|
|
4020
|
-
const width = window.innerWidth;
|
|
4021
|
-
const height = window.innerHeight;
|
|
4022
|
-
|
|
4023
|
-
const chartNode = document.querySelector("main");
|
|
4024
|
-
drawChart.default(chartNode, data, width, height);
|
|
4025
|
-
};
|
|
4026
|
-
|
|
4027
|
-
window.addEventListener('resize', run);
|
|
4028
|
-
|
|
4029
|
-
document.addEventListener('DOMContentLoaded', run);
|
|
4030
|
-
/*-->*/
|
|
4031
|
-
</script>
|
|
4032
|
-
</body>
|
|
4033
|
-
</html>
|
|
4034
|
-
|
|
4035
|
-
env":{"rollup":"2.78.1"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
|
|
4017
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"inline-style-editor.js","children":[{"name":"node_modules","children":[{"name":"svelte/internal/index.mjs","uid":"f360-106"},{"name":"d3-array/src","children":[{"uid":"f360-110","name":"ascending.js"},{"uid":"f360-112","name":"descending.js"},{"uid":"f360-114","name":"bisector.js"},{"uid":"f360-116","name":"number.js"},{"uid":"f360-118","name":"bisect.js"},{"uid":"f360-120","name":"count.js"},{"uid":"f360-122","name":"extent.js"},{"uid":"f360-124","name":"ticks.js"},{"name":"threshold/sturges.js","uid":"f360-126"}]},{"name":"d3-contour/src","children":[{"uid":"f360-128","name":"array.js"},{"uid":"f360-130","name":"ascending.js"},{"uid":"f360-132","name":"area.js"},{"uid":"f360-134","name":"constant.js"},{"uid":"f360-136","name":"contains.js"},{"uid":"f360-138","name":"noop.js"},{"uid":"f360-140","name":"contours.js"}]},{"name":"vanilla-picker/dist/vanilla-picker.csp.mjs","uid":"f360-144"}]},{"name":"src","children":[{"name":"util","children":[{"uid":"f360-108","name":"util.js"},{"uid":"f360-142","name":"boxesContour.js"},{"uid":"f360-148","name":"fonts.js"}]},{"name":"components","children":[{"uid":"f360-146","name":"ColorPicker.svelte"},{"uid":"f360-150","name":"InlineStyleEditor.svelte"}]},{"uid":"f360-152","name":"index.js"}]}]}],"isRoot":true},"nodeParts":{"f360-106":{"renderedLength":12388,"gzipLength":0,"brotliLength":0,"mainUid":"f360-105"},"f360-108":{"renderedLength":674,"gzipLength":0,"brotliLength":0,"mainUid":"f360-107"},"f360-110":{"renderedLength":125,"gzipLength":0,"brotliLength":0,"mainUid":"f360-109"},"f360-112":{"renderedLength":156,"gzipLength":0,"brotliLength":0,"mainUid":"f360-111"},"f360-114":{"renderedLength":1664,"gzipLength":0,"brotliLength":0,"mainUid":"f360-113"},"f360-116":{"renderedLength":66,"gzipLength":0,"brotliLength":0,"mainUid":"f360-115"},"f360-118":{"renderedLength":55,"gzipLength":0,"brotliLength":0,"mainUid":"f360-117"},"f360-120":{"renderedLength":480,"gzipLength":0,"brotliLength":0,"mainUid":"f360-119"},"f360-122":{"renderedLength":823,"gzipLength":0,"brotliLength":0,"mainUid":"f360-121"},"f360-124":{"renderedLength":1901,"gzipLength":0,"brotliLength":0,"mainUid":"f360-123"},"f360-126":{"renderedLength":109,"gzipLength":0,"brotliLength":0,"mainUid":"f360-125"},"f360-128":{"renderedLength":62,"gzipLength":0,"brotliLength":0,"mainUid":"f360-127"},"f360-130":{"renderedLength":56,"gzipLength":0,"brotliLength":0,"mainUid":"f360-129"},"f360-132":{"renderedLength":239,"gzipLength":0,"brotliLength":0,"mainUid":"f360-131"},"f360-134":{"renderedLength":32,"gzipLength":0,"brotliLength":0,"mainUid":"f360-133"},"f360-136":{"renderedLength":956,"gzipLength":0,"brotliLength":0,"mainUid":"f360-135"},"f360-138":{"renderedLength":22,"gzipLength":0,"brotliLength":0,"mainUid":"f360-137"},"f360-140":{"renderedLength":6572,"gzipLength":0,"brotliLength":0,"mainUid":"f360-139"},"f360-142":{"renderedLength":3648,"gzipLength":0,"brotliLength":0,"mainUid":"f360-141"},"f360-144":{"renderedLength":34619,"gzipLength":0,"brotliLength":0,"mainUid":"f360-143"},"f360-146":{"renderedLength":2497,"gzipLength":0,"brotliLength":0,"mainUid":"f360-145"},"f360-148":{"renderedLength":4880,"gzipLength":0,"brotliLength":0,"mainUid":"f360-147"},"f360-150":{"renderedLength":58190,"gzipLength":0,"brotliLength":0,"mainUid":"f360-149"},"f360-152":{"renderedLength":153,"gzipLength":0,"brotliLength":0,"mainUid":"f360-151"}},"nodeMetas":{"f360-105":{"id":"/node_modules/svelte/internal/index.mjs","moduleParts":{"inline-style-editor.js":"f360-106"},"imported":[],"importedBy":[{"uid":"f360-149"},{"uid":"f360-153"},{"uid":"f360-145"}]},"f360-107":{"id":"/src/util/util.js","moduleParts":{"inline-style-editor.js":"f360-108"},"imported":[],"importedBy":[{"uid":"f360-149"}]},"f360-109":{"id":"/node_modules/d3-array/src/ascending.js","moduleParts":{"inline-style-editor.js":"f360-110"},"imported":[],"importedBy":[{"uid":"f360-157"},{"uid":"f360-117"},{"uid":"f360-113"},{"uid":"f360-164"},{"uid":"f360-182"},{"uid":"f360-183"},{"uid":"f360-184"},{"uid":"f360-185"},{"uid":"f360-186"},{"uid":"f360-199"}]},"f360-111":{"id":"/node_modules/d3-array/src/descending.js","moduleParts":{"inline-style-editor.js":"f360-112"},"imported":[],"importedBy":[{"uid":"f360-157"},{"uid":"f360-113"}]},"f360-113":{"id":"/node_modules/d3-array/src/bisector.js","moduleParts":{"inline-style-editor.js":"f360-114"},"imported":[{"uid":"f360-109"},{"uid":"f360-111"}],"importedBy":[{"uid":"f360-157"},{"uid":"f360-117"}]},"f360-115":{"id":"/node_modules/d3-array/src/number.js","moduleParts":{"inline-style-editor.js":"f360-116"},"imported":[],"importedBy":[{"uid":"f360-117"},{"uid":"f360-179"}]},"f360-117":{"id":"/node_modules/d3-array/src/bisect.js","moduleParts":{"inline-style-editor.js":"f360-118"},"imported":[{"uid":"f360-109"},{"uid":"f360-113"},{"uid":"f360-115"}],"importedBy":[{"uid":"f360-157"},{"uid":"f360-165"}]},"f360-119":{"id":"/node_modules/d3-array/src/count.js","moduleParts":{"inline-style-editor.js":"f360-120"},"imported":[],"importedBy":[{"uid":"f360-157"},{"uid":"f360-166"},{"uid":"f360-167"},{"uid":"f360-125"}]},"f360-121":{"id":"/node_modules/d3-array/src/extent.js","moduleParts":{"inline-style-editor.js":"f360-122"},"imported":[],"importedBy":[{"uid":"f360-157"},{"uid":"f360-165"}]},"f360-123":{"id":"/node_modules/d3-array/src/ticks.js","moduleParts":{"inline-style-editor.js":"f360-124"},"imported":[],"importedBy":[{"uid":"f360-157"},{"uid":"f360-165"},{"uid":"f360-176"}]},"f360-125":{"id":"/node_modules/d3-array/src/threshold/sturges.js","moduleParts":{"inline-style-editor.js":"f360-126"},"imported":[{"uid":"f360-119"}],"importedBy":[{"uid":"f360-157"},{"uid":"f360-165"}]},"f360-127":{"id":"/node_modules/d3-contour/src/array.js","moduleParts":{"inline-style-editor.js":"f360-128"},"imported":[],"importedBy":[{"uid":"f360-139"},{"uid":"f360-156"}]},"f360-129":{"id":"/node_modules/d3-contour/src/ascending.js","moduleParts":{"inline-style-editor.js":"f360-130"},"imported":[],"importedBy":[{"uid":"f360-139"}]},"f360-131":{"id":"/node_modules/d3-contour/src/area.js","moduleParts":{"inline-style-editor.js":"f360-132"},"imported":[],"importedBy":[{"uid":"f360-139"}]},"f360-133":{"id":"/node_modules/d3-contour/src/constant.js","moduleParts":{"inline-style-editor.js":"f360-134"},"imported":[],"importedBy":[{"uid":"f360-139"},{"uid":"f360-156"}]},"f360-135":{"id":"/node_modules/d3-contour/src/contains.js","moduleParts":{"inline-style-editor.js":"f360-136"},"imported":[],"importedBy":[{"uid":"f360-139"}]},"f360-137":{"id":"/node_modules/d3-contour/src/noop.js","moduleParts":{"inline-style-editor.js":"f360-138"},"imported":[],"importedBy":[{"uid":"f360-139"}]},"f360-139":{"id":"/node_modules/d3-contour/src/contours.js","moduleParts":{"inline-style-editor.js":"f360-140"},"imported":[{"uid":"f360-157"},{"uid":"f360-127"},{"uid":"f360-129"},{"uid":"f360-131"},{"uid":"f360-133"},{"uid":"f360-135"},{"uid":"f360-137"}],"importedBy":[{"uid":"f360-155"},{"uid":"f360-156"}]},"f360-141":{"id":"/src/util/boxesContour.js","moduleParts":{"inline-style-editor.js":"f360-142"},"imported":[{"uid":"f360-155"}],"importedBy":[{"uid":"f360-149"}]},"f360-143":{"id":"/node_modules/vanilla-picker/dist/vanilla-picker.csp.mjs","moduleParts":{"inline-style-editor.js":"f360-144"},"imported":[],"importedBy":[{"uid":"f360-145"}]},"f360-145":{"id":"/src/components/ColorPicker.svelte","moduleParts":{"inline-style-editor.js":"f360-146"},"imported":[{"uid":"f360-105"},{"uid":"f360-143"},{"uid":"f360-153"}],"importedBy":[{"uid":"f360-149"}]},"f360-147":{"id":"/src/util/fonts.js","moduleParts":{"inline-style-editor.js":"f360-148"},"imported":[],"importedBy":[{"uid":"f360-149"}]},"f360-149":{"id":"/src/components/InlineStyleEditor.svelte","moduleParts":{"inline-style-editor.js":"f360-150"},"imported":[{"uid":"f360-105"},{"uid":"f360-153"},{"uid":"f360-154"},{"uid":"f360-107"},{"uid":"f360-141"},{"uid":"f360-145"},{"uid":"f360-147"}],"importedBy":[{"uid":"f360-151"}]},"f360-151":{"id":"/src/index.js","moduleParts":{"inline-style-editor.js":"f360-152"},"imported":[{"uid":"f360-149"}],"importedBy":[],"isEntry":true},"f360-153":{"id":"/node_modules/svelte/index.mjs","moduleParts":{},"imported":[{"uid":"f360-105"}],"importedBy":[{"uid":"f360-149"},{"uid":"f360-145"}]},"f360-154":{"id":"/src/assets/index.scss","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-149"}]},"f360-155":{"id":"/node_modules/d3-contour/src/index.js","moduleParts":{},"imported":[{"uid":"f360-139"},{"uid":"f360-156"}],"importedBy":[{"uid":"f360-141"}]},"f360-156":{"id":"/node_modules/d3-contour/src/density.js","moduleParts":{},"imported":[{"uid":"f360-157"},{"uid":"f360-127"},{"uid":"f360-133"},{"uid":"f360-139"}],"importedBy":[{"uid":"f360-155"}]},"f360-157":{"id":"/node_modules/d3-array/src/index.js","moduleParts":{},"imported":[{"uid":"f360-117"},{"uid":"f360-109"},{"uid":"f360-113"},{"uid":"f360-158"},{"uid":"f360-119"},{"uid":"f360-159"},{"uid":"f360-160"},{"uid":"f360-111"},{"uid":"f360-161"},{"uid":"f360-121"},{"uid":"f360-162"},{"uid":"f360-163"},{"uid":"f360-164"},{"uid":"f360-165"},{"uid":"f360-166"},{"uid":"f360-167"},{"uid":"f360-125"},{"uid":"f360-168"},{"uid":"f360-169"},{"uid":"f360-170"},{"uid":"f360-171"},{"uid":"f360-172"},{"uid":"f360-173"},{"uid":"f360-174"},{"uid":"f360-175"},{"uid":"f360-176"},{"uid":"f360-177"},{"uid":"f360-178"},{"uid":"f360-179"},{"uid":"f360-180"},{"uid":"f360-181"},{"uid":"f360-182"},{"uid":"f360-183"},{"uid":"f360-184"},{"uid":"f360-185"},{"uid":"f360-186"},{"uid":"f360-187"},{"uid":"f360-188"},{"uid":"f360-189"},{"uid":"f360-123"},{"uid":"f360-190"},{"uid":"f360-191"},{"uid":"f360-192"},{"uid":"f360-193"},{"uid":"f360-194"},{"uid":"f360-195"},{"uid":"f360-196"},{"uid":"f360-197"},{"uid":"f360-198"},{"uid":"f360-199"},{"uid":"f360-200"},{"uid":"f360-201"},{"uid":"f360-202"},{"uid":"f360-203"},{"uid":"f360-204"},{"uid":"f360-205"},{"uid":"f360-206"}],"importedBy":[{"uid":"f360-139"},{"uid":"f360-156"}]},"f360-158":{"id":"/node_modules/d3-array/src/blur.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"}]},"f360-159":{"id":"/node_modules/d3-array/src/cross.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"}]},"f360-160":{"id":"/node_modules/d3-array/src/cumsum.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"}]},"f360-161":{"id":"/node_modules/d3-array/src/deviation.js","moduleParts":{},"imported":[{"uid":"f360-191"}],"importedBy":[{"uid":"f360-157"},{"uid":"f360-167"}]},"f360-162":{"id":"/node_modules/d3-array/src/fsum.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"}]},"f360-163":{"id":"/node_modules/d3-array/src/group.js","moduleParts":{},"imported":[{"uid":"f360-206"},{"uid":"f360-207"}],"importedBy":[{"uid":"f360-157"},{"uid":"f360-164"}]},"f360-164":{"id":"/node_modules/d3-array/src/groupSort.js","moduleParts":{},"imported":[{"uid":"f360-109"},{"uid":"f360-163"},{"uid":"f360-199"}],"importedBy":[{"uid":"f360-157"}]},"f360-165":{"id":"/node_modules/d3-array/src/bin.js","moduleParts":{},"imported":[{"uid":"f360-208"},{"uid":"f360-117"},{"uid":"f360-209"},{"uid":"f360-121"},{"uid":"f360-207"},{"uid":"f360-176"},{"uid":"f360-123"},{"uid":"f360-125"}],"importedBy":[{"uid":"f360-157"}]},"f360-166":{"id":"/node_modules/d3-array/src/threshold/freedmanDiaconis.js","moduleParts":{},"imported":[{"uid":"f360-119"},{"uid":"f360-179"}],"importedBy":[{"uid":"f360-157"}]},"f360-167":{"id":"/node_modules/d3-array/src/threshold/scott.js","moduleParts":{},"imported":[{"uid":"f360-119"},{"uid":"f360-161"}],"importedBy":[{"uid":"f360-157"}]},"f360-168":{"id":"/node_modules/d3-array/src/max.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"},{"uid":"f360-179"}]},"f360-169":{"id":"/node_modules/d3-array/src/maxIndex.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"},{"uid":"f360-179"},{"uid":"f360-186"}]},"f360-170":{"id":"/node_modules/d3-array/src/mean.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"}]},"f360-171":{"id":"/node_modules/d3-array/src/median.js","moduleParts":{},"imported":[{"uid":"f360-179"}],"importedBy":[{"uid":"f360-157"}]},"f360-172":{"id":"/node_modules/d3-array/src/merge.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"}]},"f360-173":{"id":"/node_modules/d3-array/src/min.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"},{"uid":"f360-179"},{"uid":"f360-190"}]},"f360-174":{"id":"/node_modules/d3-array/src/minIndex.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"},{"uid":"f360-179"},{"uid":"f360-184"}]},"f360-175":{"id":"/node_modules/d3-array/src/mode.js","moduleParts":{},"imported":[{"uid":"f360-206"}],"importedBy":[{"uid":"f360-157"}]},"f360-176":{"id":"/node_modules/d3-array/src/nice.js","moduleParts":{},"imported":[{"uid":"f360-123"}],"importedBy":[{"uid":"f360-157"},{"uid":"f360-165"}]},"f360-177":{"id":"/node_modules/d3-array/src/pairs.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"}]},"f360-178":{"id":"/node_modules/d3-array/src/permute.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"},{"uid":"f360-199"}]},"f360-179":{"id":"/node_modules/d3-array/src/quantile.js","moduleParts":{},"imported":[{"uid":"f360-168"},{"uid":"f360-169"},{"uid":"f360-173"},{"uid":"f360-174"},{"uid":"f360-180"},{"uid":"f360-115"},{"uid":"f360-199"},{"uid":"f360-185"}],"importedBy":[{"uid":"f360-157"},{"uid":"f360-166"},{"uid":"f360-171"}]},"f360-180":{"id":"/node_modules/d3-array/src/quickselect.js","moduleParts":{},"imported":[{"uid":"f360-199"}],"importedBy":[{"uid":"f360-157"},{"uid":"f360-179"}]},"f360-181":{"id":"/node_modules/d3-array/src/range.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"}]},"f360-182":{"id":"/node_modules/d3-array/src/rank.js","moduleParts":{},"imported":[{"uid":"f360-109"},{"uid":"f360-199"}],"importedBy":[{"uid":"f360-157"}]},"f360-183":{"id":"/node_modules/d3-array/src/least.js","moduleParts":{},"imported":[{"uid":"f360-109"}],"importedBy":[{"uid":"f360-157"}]},"f360-184":{"id":"/node_modules/d3-array/src/leastIndex.js","moduleParts":{},"imported":[{"uid":"f360-109"},{"uid":"f360-174"}],"importedBy":[{"uid":"f360-157"},{"uid":"f360-187"}]},"f360-185":{"id":"/node_modules/d3-array/src/greatest.js","moduleParts":{},"imported":[{"uid":"f360-109"}],"importedBy":[{"uid":"f360-157"},{"uid":"f360-179"}]},"f360-186":{"id":"/node_modules/d3-array/src/greatestIndex.js","moduleParts":{},"imported":[{"uid":"f360-109"},{"uid":"f360-169"}],"importedBy":[{"uid":"f360-157"}]},"f360-187":{"id":"/node_modules/d3-array/src/scan.js","moduleParts":{},"imported":[{"uid":"f360-184"}],"importedBy":[{"uid":"f360-157"}]},"f360-188":{"id":"/node_modules/d3-array/src/shuffle.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"}]},"f360-189":{"id":"/node_modules/d3-array/src/sum.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"}]},"f360-190":{"id":"/node_modules/d3-array/src/transpose.js","moduleParts":{},"imported":[{"uid":"f360-173"}],"importedBy":[{"uid":"f360-157"},{"uid":"f360-192"}]},"f360-191":{"id":"/node_modules/d3-array/src/variance.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"},{"uid":"f360-161"}]},"f360-192":{"id":"/node_modules/d3-array/src/zip.js","moduleParts":{},"imported":[{"uid":"f360-190"}],"importedBy":[{"uid":"f360-157"}]},"f360-193":{"id":"/node_modules/d3-array/src/every.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"}]},"f360-194":{"id":"/node_modules/d3-array/src/some.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"}]},"f360-195":{"id":"/node_modules/d3-array/src/filter.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"}]},"f360-196":{"id":"/node_modules/d3-array/src/map.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"}]},"f360-197":{"id":"/node_modules/d3-array/src/reduce.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"}]},"f360-198":{"id":"/node_modules/d3-array/src/reverse.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"}]},"f360-199":{"id":"/node_modules/d3-array/src/sort.js","moduleParts":{},"imported":[{"uid":"f360-109"},{"uid":"f360-178"}],"importedBy":[{"uid":"f360-157"},{"uid":"f360-164"},{"uid":"f360-179"},{"uid":"f360-180"},{"uid":"f360-182"}]},"f360-200":{"id":"/node_modules/d3-array/src/difference.js","moduleParts":{},"imported":[{"uid":"f360-206"}],"importedBy":[{"uid":"f360-157"}]},"f360-201":{"id":"/node_modules/d3-array/src/disjoint.js","moduleParts":{},"imported":[{"uid":"f360-206"}],"importedBy":[{"uid":"f360-157"}]},"f360-202":{"id":"/node_modules/d3-array/src/intersection.js","moduleParts":{},"imported":[{"uid":"f360-206"}],"importedBy":[{"uid":"f360-157"}]},"f360-203":{"id":"/node_modules/d3-array/src/subset.js","moduleParts":{},"imported":[{"uid":"f360-204"}],"importedBy":[{"uid":"f360-157"}]},"f360-204":{"id":"/node_modules/d3-array/src/superset.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"},{"uid":"f360-203"}]},"f360-205":{"id":"/node_modules/d3-array/src/union.js","moduleParts":{},"imported":[{"uid":"f360-206"}],"importedBy":[{"uid":"f360-157"}]},"f360-206":{"id":"/node_modules/internmap/src/index.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-157"},{"uid":"f360-163"},{"uid":"f360-175"},{"uid":"f360-200"},{"uid":"f360-201"},{"uid":"f360-202"},{"uid":"f360-205"}]},"f360-207":{"id":"/node_modules/d3-array/src/identity.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-163"},{"uid":"f360-165"}]},"f360-208":{"id":"/node_modules/d3-array/src/array.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-165"}]},"f360-209":{"id":"/node_modules/d3-array/src/constant.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"f360-165"}]}},"env":{"rollup":"2.78.1"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
|
|
4036
4018
|
|
|
4037
4019
|
const run = () => {
|
|
4038
4020
|
const width = window.innerWidth;
|
package/test.html
CHANGED
|
@@ -348,16 +348,16 @@
|
|
|
348
348
|
<script>
|
|
349
349
|
const editor = new InlineStyleEditor(
|
|
350
350
|
{
|
|
351
|
-
|
|
351
|
+
getElems: (el) => {
|
|
352
352
|
if (el.classList.contains('adm1')) {
|
|
353
353
|
const parentCountry = el.parentNode.getAttribute('id').replace('-adm1', '');
|
|
354
354
|
const countryElem = document.getElementById(parentCountry);
|
|
355
|
-
if (countryElem) return [[countryElem, 'Italia']];
|
|
355
|
+
if (countryElem) return [[el, 'clicked'], [countryElem, 'Italia']];
|
|
356
356
|
}
|
|
357
357
|
if (el.tagName === 'tspan') {
|
|
358
|
-
return [[el.parentNode, 'text']];
|
|
358
|
+
return [[el.parentNode, 'text'], [el, 'tspan']];
|
|
359
359
|
}
|
|
360
|
-
return [];
|
|
360
|
+
return [[el, 'clicked']];
|
|
361
361
|
},
|
|
362
362
|
onStyleChanged(target, eventType, cssProp, value) {
|
|
363
363
|
console.log(target, eventType, cssProp, value);
|