diff --git a/_file/data/datavis-survey/scopes-001-input.b9718cf2.parquet b/_file/data/datavis-survey/scopes-001-input.b9718cf2.parquet new file mode 100644 index 0000000..0ee4e3b Binary files /dev/null and b/_file/data/datavis-survey/scopes-001-input.b9718cf2.parquet differ diff --git a/_file/data/datavis-survey/scopes-001.d44da6f0.json b/_file/data/datavis-survey/scopes-001.d44da6f0.json new file mode 100644 index 0000000..bf014b6 --- /dev/null +++ b/_file/data/datavis-survey/scopes-001.d44da6f0.json @@ -0,0 +1,1079 @@ +{ + "ls_version": "0.2.0", + "id": "scopes-001", + "embedding_id": "embedding-001", + "umap_id": "umap-001", + "cluster_id": "cluster-001", + "cluster_labels_id": "cluster-001-labels-001", + "label": "Datavis Not Understood", + "description": "Summarized by GPT-4-Turbo", + "dataset": { + "id": "datavis-notunderstood", + "length": 765, + "columns": [ + "DataVizNotUnderstood", + "Role", + "YearsDataVizExperience", + "Location" + ], + "text_column": "DataVizNotUnderstood", + "column_metadata": { + "DataVizNotUnderstood": { + "type": "string", + "unique_values_count": 755 + }, + "Role": { + "type": "string", + "unique_values_count": 10, + "categories": [ + "Analyst", + "Leadership (Manager, Director, VP, etc.)", + "Designer", + "Developer", + "None of these describes my role", + "Engineer", + "Scientist", + "Journalist", + "Teacher", + "Cartographer" + ], + "counts": { + "Analyst": 240, + "Leadership (Manager, Director, VP, etc.)": 110, + "Designer": 58, + "Developer": 47, + "None of these describes my role": 44, + "Engineer": 29, + "Scientist": 26, + "Journalist": 13, + "Teacher": 6, + "Cartographer": 3 + } + }, + "YearsDataVizExperience": { + "type": "string", + "unique_values_count": 31 + }, + "Location": { + "type": "string", + "unique_values_count": 62 + } + }, + "potential_embeddings": [], + "ls_version": "0.2.0" + }, + "embedding": { + "id": "embedding-001", + "model_id": "transformers-jinaai___jina-embeddings-v2-small-en", + "dataset_id": "datavis-notunderstood", + "text_column": "DataVizNotUnderstood", + "dimensions": 512, + "prefix": "" + }, + "umap": { + "id": "umap-001", + "embedding_id": "embedding-001", + "neighbors": 25, + "min_dist": 0.1 + }, + "cluster": { + "id": "cluster-001", + "umap_id": "umap-001", + "samples": 3, + "min_samples": 2, + "cluster_selection_epsilon": 0.05, + "n_clusters": 80, + "n_noise": 125 + }, + "cluster_labels": { + "id": "cluster-001-labels-001", + "cluster_id": "cluster-001", + "model_id": "openai-gpt-4-turbo-preview", + "text_column": "DataVizNotUnderstood", + "context": "", + "system_prompt": { + "role": "system", + "content": "You're job is to summarize lists of items with a short label of no more than 4 words. \n\nThe user will submit a bulleted list of items and you should choose a label that best summarizes the theme of the list so that someone browsing the labels will have a good idea of what is in the list. \nDo not use punctuation, just return a few words that summarize the list." + }, + "max_tokens": 127910 + }, + "cluster_labels_lookup": [ + { + "label": "Understanding Acknowledgment", + "description": "This is cluster 0 with 6 items.", + "hull": [ + 650, + 720, + 568, + 319, + 587 + ], + "cluster": 0 + }, + { + "label": "Data Management Challenges", + "description": "This is cluster 1 with 10 items.", + "hull": [ + 28, + 759, + 407, + 417, + 46, + 405 + ], + "cluster": 1 + }, + { + "label": "Project Management Philosophies", + "description": "This is cluster 2 with 6 items.", + "hull": [ + 364, + 135, + 212, + 146, + 367 + ], + "cluster": 2 + }, + { + "label": "Visualization Time Challenges", + "description": "This is cluster 3 with 11 items.", + "hull": [ + 444, + 504, + 269, + 217, + 628, + 737, + 5 + ], + "cluster": 3 + }, + { + "label": "Data Viz Creation Time", + "description": "This is cluster 4 with 11 items.", + "hull": [], + "cluster": 4 + }, + { + "label": "Complex Simplicity Efforts", + "description": "This is cluster 5 with 6 items.", + "hull": [ + 404, + 534, + 521, + 762, + 432 + ], + "cluster": 5 + }, + { + "label": "Design Time and Value", + "description": "This is cluster 6 with 9 items.", + "hull": [ + 586, + 496, + 669, + 60, + 648, + 715 + ], + "cluster": 6 + }, + { + "label": "Design philosophy insights", + "description": "This is cluster 7 with 6 items.", + "hull": [ + 183, + 275, + 43, + 38 + ], + "cluster": 7 + }, + { + "label": "Design Principles", + "description": "This is cluster 8 with 8 items.", + "hull": [ + 606, + 192, + 421 + ], + "cluster": 8 + }, + { + "label": "Design Process Insights", + "description": "This is cluster 9 with 5 items.", + "hull": [ + 563, + 387, + 579 + ], + "cluster": 9 + }, + { + "label": "Design principles challenges", + "description": "This is cluster 10 with 4 items.", + "hull": [ + 235, + 588, + 602, + 672 + ], + "cluster": 10 + }, + { + "label": "Effort and Work Insights", + "description": "This is cluster 11 with 11 items.", + "hull": [ + 423, + 603, + 344, + 159, + 62 + ], + "cluster": 11 + }, + { + "label": "Job Understanding Challenges", + "description": "This is cluster 12 with 5 items.", + "hull": [ + 566, + 72, + 310, + 433 + ], + "cluster": 12 + }, + { + "label": "Information and Trends", + "description": "This is cluster 13 with 7 items.", + "hull": [ + 753, + 58, + 252, + 655, + 642 + ], + "cluster": 13 + }, + { + "label": "Time Investment Insights", + "description": "This is cluster 14 with 39 items.", + "hull": [ + 654, + 703, + 569, + 713, + 226, + 743, + 537, + 522 + ], + "cluster": 14 + }, + { + "label": "No issues reported", + "description": "This is cluster 15 with 6 items.", + "hull": [ + 196, + 698, + 466, + 179 + ], + "cluster": 15 + }, + { + "label": "Data visualization challenges", + "description": "This is cluster 16 with 5 items.", + "hull": [ + 317, + 470, + 709, + 289, + 406 + ], + "cluster": 16 + }, + { + "label": "Data Management Challenges", + "description": "This is cluster 17 with 6 items.", + "hull": [ + 708, + 590, + 234, + 99 + ], + "cluster": 17 + }, + { + "label": "Design Principles", + "description": "This is cluster 18 with 8 items.", + "hull": [ + 224, + 45, + 438, + 763, + 338, + 4 + ], + "cluster": 18 + }, + { + "label": "Data Preparation Challenges", + "description": "This is cluster 19 with 5 items.", + "hull": [ + 251, + 156, + 624, + 81 + ], + "cluster": 19 + }, + { + "label": "Project Time Complexity", + "description": "This is cluster 20 with 15 items.", + "hull": [ + 208, + 393, + 301, + 8, + 714, + 736 + ], + "cluster": 20 + }, + { + "label": "Time and Effort Concerns", + "description": "This is cluster 21 with 18 items.", + "hull": [ + 584, + 152, + 59, + 623, + 618, + 670, + 266, + 494 + ], + "cluster": 21 + }, + { + "label": "Critical Thinking Tips", + "description": "This is cluster 22 with 6 items.", + "hull": [ + 10, + 652, + 605, + 316 + ], + "cluster": 22 + }, + { + "label": "Miscellaneous Responses", + "description": "This is cluster 23 with 26 items.", + "hull": [ + 373, + 543, + 281 + ], + "cluster": 23 + }, + { + "label": "Data Visualization Myths", + "description": "This is cluster 24 with 8 items.", + "hull": [ + 15, + 538, + 211, + 693, + 458 + ], + "cluster": 24 + }, + { + "label": "Creative process challenges", + "description": "This is cluster 25 with 4 items.", + "hull": [ + 32, + 356, + 374 + ], + "cluster": 25 + }, + { + "label": "Misconceptions about Work", + "description": "This is cluster 26 with 11 items.", + "hull": [ + 674, + 484, + 227, + 20, + 760 + ], + "cluster": 26 + }, + { + "label": "Data Cleaning Challenges", + "description": "This is cluster 27 with 19 items.", + "hull": [ + 447, + 172, + 710, + 371, + 695 + ], + "cluster": 27 + }, + { + "label": "Data Preparation Challenges", + "description": "This is cluster 28 with 5 items.", + "hull": [ + 506, + 151, + 57, + 105, + 114 + ], + "cluster": 28 + }, + { + "label": "Design Appreciation Challenges", + "description": "This is cluster 29 with 3 items.", + "hull": [ + 68, + 425, + 525 + ], + "cluster": 29 + }, + { + "label": "Misunderstood design importance", + "description": "This is cluster 30 with 4 items.", + "hull": [ + 142, + 139, + 351 + ], + "cluster": 30 + }, + { + "label": "Complexity and Difficulty", + "description": "This is cluster 31 with 5 items.", + "hull": [ + 51, + 345, + 369, + 395 + ], + "cluster": 31 + }, + { + "label": "Expectation Misalignment", + "description": "This is cluster 32 with 3 items.", + "hull": [ + 527, + 662, + 725 + ], + "cluster": 32 + }, + { + "label": "Data Visualization Insights", + "description": "This is cluster 33 with 4 items.", + "hull": [ + 513, + 88, + 581, + 689 + ], + "cluster": 33 + }, + { + "label": "Attention to Detail", + "description": "This is cluster 34 with 4 items.", + "hull": [ + 86, + 408, + 119, + 688 + ], + "cluster": 34 + }, + { + "label": "Project feedback themes", + "description": "This is cluster 35 with 7 items.", + "hull": [ + 465, + 560, + 388, + 550, + 265 + ], + "cluster": 35 + }, + { + "label": "Data Tool Limitations", + "description": "This is cluster 36 with 12 items.", + "hull": [ + 213, + 732, + 164, + 505, + 35, + 96 + ], + "cluster": 36 + }, + { + "label": "Storytelling techniques", + "description": "This is cluster 37 with 4 items.", + "hull": [ + 666, + 562, + 323, + 571, + 514 + ], + "cluster": 37 + }, + { + "label": "Misconceptions in Design", + "description": "This is cluster 38 with 12 items.", + "hull": [ + 376, + 491, + 93, + 507 + ], + "cluster": 38 + }, + { + "label": "Data Analysis Challenges", + "description": "This is cluster 39 with 7 items.", + "hull": [ + 746, + 329, + 609, + 138, + 161, + 133, + 292 + ], + "cluster": 39 + }, + { + "label": "Data Visualization Challenges", + "description": "This is cluster 40 with 8 items.", + "hull": [ + 239, + 340, + 157, + 386, + 56 + ], + "cluster": 40 + }, + { + "label": "Importance of Understanding", + "description": "This is cluster 41 with 7 items.", + "hull": [ + 495, + 353, + 389, + 690, + 399 + ], + "cluster": 41 + }, + { + "label": "Dataviz Misconceptions", + "description": "This is cluster 42 with 3 items.", + "hull": [ + 500, + 480, + 154 + ], + "cluster": 42 + }, + { + "label": "Misunderstood professional challenges", + "description": "This is cluster 43 with 8 items.", + "hull": [ + 270, + 567, + 260, + 166, + 684, + 610 + ], + "cluster": 43 + }, + { + "label": "Misunderstood Professional Value", + "description": "This is cluster 44 with 10 items.", + "hull": [ + 65, + 314, + 9, + 758, + 410, + 47, + 757 + ], + "cluster": 44 + }, + { + "label": "Data Visualization Essentials", + "description": "This is cluster 45 with 10 items.", + "hull": [ + 199, + 366, + 696, + 582, + 163, + 21, + 361 + ], + "cluster": 45 + }, + { + "label": "Data Management Insights", + "description": "This is cluster 46 with 5 items.", + "hull": [ + 19, + 167, + 309, + 508 + ], + "cluster": 46 + }, + { + "label": "Data Communication Strategy", + "description": "This is cluster 47 with 6 items.", + "hull": [ + 173, + 82, + 511, + 328 + ], + "cluster": 47 + }, + { + "label": "Business Knowledge Importance", + "description": "This is cluster 48 with 22 items.", + "hull": [ + 336, + 518, + 450, + 596, + 293, + 476, + 87, + 533 + ], + "cluster": 48 + }, + { + "label": "Challenges in Expertise Development", + "description": "This is cluster 49 with 9 items.", + "hull": [ + 307, + 197, + 744, + 707, + 48 + ], + "cluster": 49 + }, + { + "label": "Excel vs Data Viz Misconceptions", + "description": "This is cluster 50 with 5 items.", + "hull": [ + 103, + 454, + 210, + 699 + ], + "cluster": 50 + }, + { + "label": "Data Visualization Challenges", + "description": "This is cluster 51 with 11 items.", + "hull": [ + 675, + 306, + 123, + 91, + 532, + 53 + ], + "cluster": 51 + }, + { + "label": "Data Visualization Challenges", + "description": "This is cluster 52 with 6 items.", + "hull": [ + 431, + 640, + 54, + 643 + ], + "cluster": 52 + }, + { + "label": "Challenges in Decision-Making", + "description": "This is cluster 53 with 7 items.", + "hull": [ + 585, + 355, + 155, + 291, + 311 + ], + "cluster": 53 + }, + { + "label": "Understanding Challenges", + "description": "This is cluster 54 with 6 items.", + "hull": [ + 67, + 613, + 429, + 731 + ], + "cluster": 54 + }, + { + "label": "Data visualization challenges", + "description": "This is cluster 55 with 5 items.", + "hull": [ + 749, + 545, + 320, + 229 + ], + "cluster": 55 + }, + { + "label": "Resistance to Data Visualization", + "description": "This is cluster 56 with 8 items.", + "hull": [ + 26, + 490, + 665, + 298, + 30, + 61 + ], + "cluster": 56 + }, + { + "label": "Challenges in Data Visualization", + "description": "This is cluster 57 with 10 items.", + "hull": [ + 7, + 174, + 535, + 607, + 198 + ], + "cluster": 57 + }, + { + "label": "Data Visualization Challenges", + "description": "This is cluster 58 with 12 items.", + "hull": [ + 134, + 501, + 472, + 558, + 442 + ], + "cluster": 58 + }, + { + "label": "Data Visualization Time Commitment", + "description": "This is cluster 59 with 23 items.", + "hull": [ + 27, + 3, + 333, + 673, + 222, + 519, + 424, + 740 + ], + "cluster": 59 + }, + { + "label": "Data Literacy Insights", + "description": "This is cluster 60 with 11 items.", + "hull": [ + 468, + 402, + 294, + 486, + 729, + 25, + 397, + 187 + ], + "cluster": 60 + }, + { + "label": "Data Visualization Misconceptions", + "description": "This is cluster 61 with 8 items.", + "hull": [ + 126, + 346, + 755, + 194, + 692, + 392 + ], + "cluster": 61 + }, + { + "label": "Data Visualization Importance", + "description": "This is cluster 62 with 5 items.", + "hull": [ + 463, + 443, + 499, + 141 + ], + "cluster": 62 + }, + { + "label": "Challenges in Data Visualization", + "description": "This is cluster 63 with 12 items.", + "hull": [ + 92, + 685, + 516, + 574, + 272 + ], + "cluster": 63 + }, + { + "label": "Dataviz Misconceptions", + "description": "This is cluster 64 with 14 items.", + "hull": [ + 216, + 113, + 302, + 556, + 102, + 131 + ], + "cluster": 64 + }, + { + "label": "Data Visualization Efforts", + "description": "This is cluster 65 with 9 items.", + "hull": [ + 653, + 177, + 723, + 493, + 595, + 186 + ], + "cluster": 65 + }, + { + "label": "Visualization challenges and value", + "description": "This is cluster 66 with 10 items.", + "hull": [ + 121, + 271, + 721, + 401, + 339, + 677, + 189 + ], + "cluster": 66 + }, + { + "label": "Data Visualization Process", + "description": "This is cluster 67 with 13 items.", + "hull": [ + 168, + 110, + 726, + 706, + 611, + 593 + ], + "cluster": 67 + }, + { + "label": "Data Visualization Challenges", + "description": "This is cluster 68 with 27 items.", + "hull": [ + 418, + 89, + 630, + 594, + 203, + 276, + 108, + 629 + ], + "cluster": 68 + }, + { + "label": "Misconceptions in Data Visualization", + "description": "This is cluster 69 with 18 items.", + "hull": [ + 730, + 552, + 512, + 461, + 278, + 530, + 370 + ], + "cluster": 69 + }, + { + "label": "Data Visualization Misconceptions", + "description": "This is cluster 70 with 19 items.", + "hull": [ + 700, + 124, + 608, + 18, + 679, + 341, + 120 + ], + "cluster": 70 + }, + { + "label": "Data Visualization Insights", + "description": "This is cluster 71 with 10 items.", + "hull": [ + 100, + 223, + 580, + 321, + 165, + 348, + 178 + ], + "cluster": 71 + }, + { + "label": "Data Reporting Best Practices", + "description": "This is cluster 72 with 3 items.", + "hull": [ + 549, + 225, + 55 + ], + "cluster": 72 + }, + { + "label": "Data Analysis Insights", + "description": "This is cluster 73 with 12 items.", + "hull": [ + 284, + 400, + 671, + 526, + 529, + 218, + 555 + ], + "cluster": 73 + }, + { + "label": "Data Visualization Insights", + "description": "This is cluster 74 with 7 items.", + "hull": [ + 546, + 111, + 283, + 326, + 712, + 350 + ], + "cluster": 74 + }, + { + "label": "Data Visualization Insights", + "description": "This is cluster 75 with 4 items.", + "hull": [ + 604, + 290, + 347, + 428 + ], + "cluster": 75 + }, + { + "label": "Data Visualization Advocacy", + "description": "This is cluster 76 with 10 items.", + "hull": [ + 22, + 612, + 83 + ], + "cluster": 76 + }, + { + "label": "Data Visualization Insights", + "description": "This is cluster 77 with 8 items.", + "hull": [ + 188, + 312, + 553, + 195 + ], + "cluster": 77 + }, + { + "label": "Data Visualization Importance", + "description": "This is cluster 78 with 8 items.", + "hull": [ + 337, + 657, + 705, + 414, + 112 + ], + "cluster": 78 + }, + { + "label": "Data Visualization Insights", + "description": "This is cluster 79 with 25 items.", + "hull": [ + 398, + 377, + 734, + 697, + 637, + 299, + 144, + 464 + ], + "cluster": 79 + } + ], + "rows": 747, + "columns": [ + "x", + "y", + "cluster", + "raw_cluster", + "label", + "ls_index" + ], + "size": 20553, + "timestamp": "2024-05-01 12:54:12" +} \ No newline at end of file diff --git a/_file/index.e65534ab.css b/_file/index.e65534ab.css new file mode 100644 index 0000000..982f30f --- /dev/null +++ b/_file/index.e65534ab.css @@ -0,0 +1,90 @@ + +/* HEADER STYLES */ +#observablehq-header a[href] { + color: inherit; +} + +#observablehq-header a[target="_blank"] { + display: flex; + align-items: center; + gap: 0.25rem; + text-decoration: none; +} + +#observablehq-header a[target="_blank"]:hover span { + text-decoration: underline; +} + +#observablehq-header a[target="_blank"]::after { + content: "↗"; +} + +@container not (min-width: 640px) { + .hide-if-small { + display: none; + } +} + + +/* DOCUMENTATION STYLES */ +.pageshot { + width: 60%; +} +.screenshot { + width: 55%; + margin: 0 24px; + box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.3); + margin-bottom: 16px; +} + +@container not (min-width: 640px) { + .pageshot { + width: 100%; + } + .screenshot { + width: 100%; + } +} + + +.static-table input[type=checkbox] { + display: none; +} + +/* HULL COMPONENT */ +.hull { + display: block; +} + +/* TOOLTIP STYLES */ +.tooltip { + position: absolute; + pointer-events: none; + z-index: 1000; + background-color: white; + padding: 8px; + border-radius: 4px; + box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.3); +} + +.cluster-content { + display: flex; + flex-direction: row; +} +.cluster-plot { + background-color: white; + padding: 4px; + border-radius: 4px; + margin: 6px; + width: 300px; + max-width: 300px; + display: inline-block; +} +.cluster-description { + margin: 6px; + padding: 4px; + +} + +@container not (min-width: 640px) { +} \ No newline at end of file diff --git a/_import/components/clusterCard.3a640b4d.js b/_import/components/clusterCard.3a640b4d.js new file mode 100644 index 0000000..fe65d4a --- /dev/null +++ b/_import/components/clusterCard.3a640b4d.js @@ -0,0 +1,56 @@ +import {html} from "../../_npm/htl@0.3.1/_esm.js"; +import * as Inputs from "../../_observablehq/stdlib/inputs.js"; +import * as Plot from "../../_npm/@observablehq/plot@0.6.14/_esm.js"; + +export function clusterCard(cluster, description, da, scope) { + const cda = da.filter(d => d.cluster == cluster) + return html`
+
+

Cluster ${cluster}: ${scope.cluster_labels_lookup[cluster].label}

+

${cda.length} rows

+
+
+ ${ + Plot.plot({ + marks: [ + Plot.dot(da, { + x: "x", + y: "y", + fill: "lightgray", + }), + Plot.dot(da, { + filter: d => d.cluster == cluster, + x: "x", + y: "y", + fill: "cluster", + }) + ], + width: 300, + height: 300, + color: { scheme: "cool" }, + y: { axis: null}, + x: { axis: null } + }) + } +
+
+ ${description} +
+
+
+ ${Inputs.table(cda, { + columns: [ + "DataVizNotUnderstood", + "Role", + "YearsDataVizExperience", + ], + width: { + "DataVizNotUnderstood": "60%", + "YearsDataVizExperience": "100px" + }, + rows: 12 + })} +
+
` +} + diff --git a/_import/components/hull.532abe46.js b/_import/components/hull.532abe46.js new file mode 100644 index 0000000..4ebc0ab --- /dev/null +++ b/_import/components/hull.532abe46.js @@ -0,0 +1,92 @@ +import { create, select } from "../../_npm/d3-selection@3.0.0/_esm.js"; +import { transition } from "../../_npm/d3-transition@3.0.1/_esm.js"; +import { line, curveLinearClosed, curveCatmullRomClosed } from "../../_npm/d3-shape@3.2.0/_esm.js"; +import { easeCubicInOut, easeExpOut } from "../../_npm/d3-ease@3.0.1/_esm.js"; +import { scaleLinear, scaleSequential } from "../../_npm/d3-scale@4.0.2/_esm.js"; +import { extent, range } from "../../_npm/d3-array@3.2.4/_esm.js"; +import { rgb } from "../../_npm/d3-color@3.1.0/_esm.js"; + +{/* */} +{/* */} +{/* */} + +export function hull(hulls, { + // TODO: make this not rerender every time + // svg = document.createElement("svg"), + width, + height, + xd = [-1, 1], + yd = [-1, 1], + x = (d) => d.x, + y = (d) => d.y, + strokeWidth = 2, + fill = "none", + stroke = "black", + duration = 1000, + delay = 0, + ease = easeCubicInOut +} = {}) { + + const svgs = create("svg") + .attr("width", width) + .attr("height", height) + .attr("viewBox", [0, 0, width, height]) + .attr("style", "max-width: 100%; height: auto; display: block;") + + + const xScaleFactor = width / (xd[1] - xd[0]); + const yScaleFactor = height / (yd[1] - yd[0]); + + // Calculate translation to center the drawing at (0,0) + // This centers the view at (0,0) and accounts for the SVG's inverted y-axis + const xOffset = width / 2 - (xScaleFactor * (xd[1] + xd[0]) / 2); + const yOffset = height / 2 + (yScaleFactor * (yd[1] + yd[0]) / 2); + + // Calculate a scaled stroke width + const scaledStrokeWidth = strokeWidth / Math.sqrt(xScaleFactor * yScaleFactor) / 2; + + const g = svgs.append("g") + g.attr('transform', `translate(${xOffset}, ${yOffset}) scale(${xScaleFactor}, ${yScaleFactor})`); + + const draw = line() + .x(d => d.x) + .y(d => -d.y) + // .curve(curveCatmullRomClosed); + .curve(curveLinearClosed); + + let sel = g.selectAll("path.hull") + .data(hulls) + + const exit = sel.exit() + // .transition() + // .duration(duration) + // .delay(delay) + // .ease(easeExpOut) + .style("opacity", 0) + .remove() + + const enter = sel.enter() + .append("path") + .classed("hull", true) + .attr("d", draw) + .style("fill", fill) + .style("stroke", stroke) + .style("stroke-width", scaledStrokeWidth) + // .style("opacity", 0.) + // .transition() + // .delay(delay + 100) + // .duration(duration - 100) + // .ease(easeExpOut) + .style("opacity", 0.75) + + const update = sel + // .transition() + // .duration(duration) + // .delay(delay) + // .ease(easeCubicInOut) + .style("opacity", 0.75) + .attr("d", draw) + + + return svgs.node() +} diff --git a/_import/components/scatter.e6a504c8.js b/_import/components/scatter.e6a504c8.js new file mode 100644 index 0000000..9461273 --- /dev/null +++ b/_import/components/scatter.e6a504c8.js @@ -0,0 +1,127 @@ +// import * as Plot from "npm:@observablehq/plot"; +import createScatterplot from "../../_npm/regl-scatterplot@1.8.5/_esm.js"; +import { scaleLinear, scaleSequential } from "../../_npm/d3-scale@4.0.2/_esm.js"; +import { interpolateViridis, interpolateTurbo, interpolateCool } from "../../_npm/d3-scale-chromatic@3.1.0/_esm.js"; +import { extent, range } from "../../_npm/d3-array@3.2.4/_esm.js"; +import { rgb } from "../../_npm/d3-color@3.1.0/_esm.js"; + +const scatterCache = new WeakMap(); + +export function scatter(data, { + canvas = document.createElement("canvas"), + width, + height, + x = (d) => d.x, + y = (d) => d.y, + color = null, + size = null, + colorInterpolator = interpolateCool, + pointSize = 3, + pointOpacity = 0.75 +} = {}) { + let scatterplot; + if(!scatterCache.has(canvas)) { + // create the scatterplot + const scatterSettings = { + canvas, + width, + height, + pointColorHover: [0.1, 0.1, 0.1, 0.5], + pointSize, + pointOpacity, + xScale: scaleLinear().domain([-1, 1]), + yScale: scaleLinear().domain([-1, 1]), + } + scatterplot = createScatterplot(scatterSettings); + scatterCache.set(canvas, scatterplot) + canvas.value = { + xd: [-1, 1], + yd: [-1, 1], + selected: [], + hovered: [], + width, + height + } + + scatterplot.subscribe( + "view", + ({ camera, view, xScale: xs, yScale: ys }) => { + let xd = xs.domain(); + let yd = ys.domain(); + canvas.value.xd = xd + canvas.value.yd = yd + canvas.dispatchEvent(new Event("input")); + } + ); + scatterplot.subscribe("select", ({ points }) => { + canvas.value.selected= points + canvas.dispatchEvent(new Event("input")); + }); + scatterplot.subscribe("deselect", () => { + canvas.value.selected = [] + canvas.dispatchEvent(new Event("input")); + }); + scatterplot.subscribe("pointOver", (pointIndex) => { + canvas.value.hovered = [pointIndex] + canvas.dispatchEvent(new Event("input")); + }); + scatterplot.subscribe("pointOut", (pointIndex) => { + canvas.value.hovered = [] + canvas.dispatchEvent(new Event("input")); + }); + canvas.scatter = scatterplot + } else { + // update the scatterplot + scatterplot = scatterCache.get(canvas) + scatterplot.set({ width, height }); + canvas.value.width = width + canvas.value.height = height + canvas.dispatchEvent(new Event("input")); + } + + const points = data.map(d => [ + x(d), y(d), color && color(d), size && size(d) + ].filter(x => x !== null)) + + if(color) { + scatterplot.set({colorBy: 'valueA'}) + // determine if the values in ordinal or continuous + const valueSet = new Set(points.map(p => p[2])); + const isOrdinal = [...valueSet].every(val => typeof val === 'string' || (typeof val === 'number' && !Number.isInteger(val) && val % 1 !== 0)); + if (isOrdinal) { + // create a color for each unique value + const uniqueValues = [...valueSet].sort(); + const colorScale = scaleSequential(colorInterpolator) + .domain([0, uniqueValues.length]); + const pointColor = uniqueValues.map((u,i) => rgb(colorScale(i)).hex()) + + // update the points to use the index of the unique value (for regl-scatterplot) + points.forEach(p => p[2] = uniqueValues.indexOf(p[2])) + + scatterplot.set({ pointColor }); + } else { + + //make sure the points scale from 0 to 1 for regl-scatter + const values = [...valueSet] + const scale = scaleLinear().domain(extent(values)).range([0, 1]) + points.forEach(p => p[2] = scale(p[2])) + + let r = range(0, 100) + const colorScale = scaleSequential(colorInterpolator) + .domain([0, 100]); + const pointColor = r.map(i => rgb(colorScale(i)).hex()) + + scatterplot.set({ pointColor }); // getContinuousColorScale is a hypothetical function + } + } + if(size) { + if(color) { + scatterplot.set({sizeBy: 'valueB'}) + } else { + scatterplot.set({sizeBy: 'valueA'}) + } + } + + scatterplot.draw(points, { transition: false }); + return canvas +} diff --git a/_import/components/tooltip.10184b2e.js b/_import/components/tooltip.10184b2e.js new file mode 100644 index 0000000..35e17e8 --- /dev/null +++ b/_import/components/tooltip.10184b2e.js @@ -0,0 +1,27 @@ +import { create } from "../../_npm/d3-selection@3.0.0/_esm.js" +import { scaleLinear } from "../../_npm/d3-scale@4.0.2/_esm.js" + + +export function tooltip({ +} = {}) { + const tooltip = create("div") + .attr("class", "tooltip") + + function show(p, map, html) { + tooltip.html(html) + tooltip.style("display", "block") + let x = scaleLinear().domain(map.xd).range([0, map.width]) + let y = scaleLinear().domain(map.yd).range([map.height, 0]) + tooltip.style("left", `${x(p.x) + 10}px`) + tooltip.style("top", `${y(p.y)}px`) + } + function hide() { + tooltip.style("display", "none") + } + + return Object.assign(tooltip.node(), { + show, + hide + }) +} + diff --git a/_npm/@observablehq/plot@0.6.14/_esm.js b/_npm/@observablehq/plot@0.6.14/_esm.js new file mode 100644 index 0000000..11be5c6 --- /dev/null +++ b/_npm/@observablehq/plot@0.6.14/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/@observablehq/plot@0.6.14/src/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +import{ascending as t,descending as n,timeSecond as e,timeMinute as r,timeHour as o,timeDay as i,timeMonday as a,timeTuesday as l,timeWednesday as s,timeThursday as c,timeFriday as u,timeSaturday as f,timeSunday as h,timeWeek as d,timeMonth as p,timeYear as m,utcSecond as y,utcMinute as g,utcHour as v,unixDay as x,utcMonday as w,utcTuesday as b,utcWednesday as k,utcThursday as $,utcFriday as M,utcSaturday as L,utcSunday as A,utcWeek as E,utcMonth as z,utcYear as O,bisector as S,max as N,pairs as C,timeFormat as T,utcFormat as R,range as I,quantile as W,symbolAsterisk as j,symbolCircle as B,symbolCross as F,symbolDiamond as D,symbolDiamond2 as q,symbolPlus as _,symbolSquare as P,symbolSquare2 as V,symbolStar as H,symbolTimes as Y,symbolTriangle as U,symbolTriangle2 as X,symbolWye as G,randomLcg as Z,group as J,sort as K,rollup as Q,sum as tt,InternSet as nt,mode as et,variance as rt,median as ot,mean as at,maxIndex as lt,minIndex as st,min as ct,deviation as ut,rollups as ft,select as ht,creator as dt,geoTransform as pt,geoPath as mt,geoClipRectangle as yt,geoStream as gt,geoTransverseMercator as vt,geoStereographic as xt,geoOrthographic as wt,geoMercator as bt,geoGnomonic as kt,geoEquirectangular as $t,geoEqualEarth as Mt,geoAzimuthalEquidistant as Lt,geoAzimuthalEqualArea as At,geoAlbersUsa as Et,geoConicEquidistant as zt,geoConicEqualArea as Ot,geoConicConformal as St,geoAlbers as Nt,quantize as Ct,schemeAccent as Tt,schemeCategory10 as Rt,schemeDark2 as It,schemeObservable10 as Wt,schemePaired as jt,schemePastel1 as Bt,schemePastel2 as Ft,schemeSet1 as Dt,schemeSet2 as qt,schemeSet3 as _t,schemeTableau10 as Pt,interpolateBrBG as Vt,schemeBrBG as Ht,interpolatePRGn as Yt,schemePRGn as Ut,interpolatePiYG as Xt,schemePiYG as Gt,interpolatePuOr as Zt,schemePuOr as Jt,interpolateRdBu as Kt,schemeRdBu as Qt,interpolateRdGy as tn,schemeRdGy as nn,interpolateRdYlBu as en,schemeRdYlBu as rn,interpolateRdYlGn as on,schemeRdYlGn as an,interpolateSpectral as ln,schemeSpectral as sn,interpolateBlues as cn,schemeBlues as un,interpolateGreens as fn,schemeGreens as hn,interpolateGreys as dn,schemeGreys as pn,interpolateOranges as mn,schemeOranges as yn,interpolatePurples as gn,schemePurples as vn,interpolateReds as xn,schemeReds as wn,interpolateTurbo as bn,interpolateViridis as kn,interpolateMagma as $n,interpolateInferno as Mn,interpolatePlasma as Ln,interpolateCividis as An,interpolateCubehelixDefault as En,interpolateWarm as zn,interpolateCool as On,interpolateBuGn as Sn,schemeBuGn as Nn,interpolateBuPu as Cn,schemeBuPu as Tn,interpolateGnBu as Rn,schemeGnBu as In,interpolateOrRd as Wn,schemeOrRd as jn,interpolatePuBu as Bn,schemePuBu as Fn,interpolatePuBuGn as Dn,schemePuBuGn as qn,interpolatePuRd as _n,schemePuRd as Pn,interpolateRdPu as Vn,schemeRdPu as Hn,interpolateYlGn as Yn,schemeYlGn as Un,interpolateYlGnBu as Xn,schemeYlGnBu as Gn,interpolateYlOrBr as Zn,schemeYlOrBr as Jn,interpolateYlOrRd as Kn,schemeYlOrRd as Qn,interpolateRainbow as te,interpolateSinebow as ne,scaleLinear as ee,scalePow as re,scaleLog as oe,scaleSymlog as ie,scaleQuantile as ae,extent as le,ticks as se,interpolateNumber as ce,reverse as ue,scaleThreshold as fe,scaleIdentity as he,piecewise as de,interpolateRgb as pe,interpolateRound as me,interpolateHsl as ye,interpolateHcl as ge,interpolateLab as ve,scaleDiverging as xe,scaleDivergingPow as we,scaleDivergingLog as be,scaleDivergingSymlog as ke,scaleTime as $e,scaleUtc as Me,scaleImplicit as Le,scaleOrdinal as Ae,scalePoint as Ee,scaleBand as ze,symbolsStroke as Oe,symbolsFill as Se,namespaces as Ne,cross as Ce,InternMap as Te,pointer as Re,format as Ie,axisBottom as We,pathRound as je,rgb as Be,curveLinear as Fe,curveBasis as De,curveBasisClosed as qe,curveBasisOpen as _e,curveBundle as Pe,curveBumpX as Ve,curveBumpY as He,curveCardinal as Ye,curveCardinalClosed as Ue,curveCardinalOpen as Xe,curveCatmullRom as Ge,curveCatmullRomClosed as Ze,curveCatmullRomOpen as Je,curveLinearClosed as Ke,curveMonotoneX as Qe,curveMonotoneY as tr,curveNatural as nr,curveStep as er,curveStepAfter as rr,curveStepBefore as or,thresholdSturges as ir,thresholdScott as ar,thresholdFreedmanDiaconis as lr,utcTickInterval as sr,tickIncrement as cr,bisect as ur,cumsum as fr,groupSort as hr,greatest as dr,area as pr,line as mr,rank as yr,count as gr,blurImage as vr,Delaunay as xr,blur2 as wr,contours as br,nice as kr,contourDensity as $r,geoGraticule10 as Mr,stratify as Lr,tree as Ar,cluster as Er,geoCentroid as zr,least as Or}from"../../d3@7.9.0/_esm.js";import{parse as Sr,format as Nr}from"../../isoformat@0.2.1/_esm.js";import Cr from"../../interval-tree-1d@1.0.4/_esm.js";function Tr(t){return null!=t&&!Number.isNaN(t)}function Rr(n,e){return+Tr(e)-+Tr(n)||t(n,e)}function Ir(t,e){return+Tr(e)-+Tr(t)||n(t,e)}function Wr(t){return null!=t&&""!=`${t}`}function jr(t){return isFinite(t)?t:NaN}function Br(t){return t>0&&isFinite(t)?t:NaN}function Fr(t){return t<0&&isFinite(t)?t:NaN}function Dr(t){if(null==t)return;const e=t[0],r=t[t.length-1];return n(e,r)}const qr=1e3,_r=6e4,Pr=36e5,Vr=864e5,Hr=7*Vr,Yr=30*Vr,Ur=365*Vr,Xr=[["millisecond",1],["2 milliseconds",2],["5 milliseconds",5],["10 milliseconds",10],["20 milliseconds",20],["50 milliseconds",50],["100 milliseconds",100],["200 milliseconds",200],["500 milliseconds",500],["second",qr],["5 seconds",5e3],["15 seconds",15e3],["30 seconds",3e4],["minute",_r],["5 minutes",3e5],["15 minutes",9e5],["30 minutes",18e5],["hour",Pr],["3 hours",108e5],["6 hours",216e5],["12 hours",432e5],["day",Vr],["2 days",2*Vr],["week",Hr],["2 weeks",2*Hr],["month",Yr],["3 months",3*Yr],["6 months",6*Yr],["year",Ur],["2 years",2*Ur],["5 years",5*Ur],["10 years",10*Ur],["20 years",20*Ur],["50 years",50*Ur],["100 years",100*Ur]],Gr=new Map([["second",qr],["minute",_r],["hour",Pr],["day",Vr],["monday",Hr],["tuesday",Hr],["wednesday",Hr],["thursday",Hr],["friday",Hr],["saturday",Hr],["sunday",Hr],["week",Hr],["month",Yr],["year",Ur]]),Zr=new Map([["second",e],["minute",r],["hour",o],["day",i],["monday",a],["tuesday",l],["wednesday",s],["thursday",c],["friday",u],["saturday",f],["sunday",h],["week",d],["month",p],["year",m]]),Jr=new Map([["second",y],["minute",g],["hour",v],["day",x],["monday",w],["tuesday",b],["wednesday",k],["thursday",$],["friday",M],["saturday",L],["sunday",A],["week",E],["month",z],["year",O]]),Kr=Symbol("intervalDuration"),Qr=Symbol("intervalType");for(const[t,n]of Zr)n[Kr]=Gr.get(t),n[Qr]="time";for(const[t,n]of Jr)n[Kr]=Gr.get(t),n[Qr]="utc";const to=[["year",O,"utc"],["month",z,"utc"],["day",x,"utc",6*Yr],["hour",v,"utc",3*Vr],["minute",g,"utc",216e5],["second",y,"utc",18e5]],no=[["year",m,"time"],["month",p,"time"],["day",i,"time",6*Yr],["hour",o,"time",3*Vr],["minute",r,"time",216e5],["second",e,"time",18e5]],eo=[to[0],no[0],to[1],no[1],to[2],no[2],...to.slice(3)];function ro(t){let n=`${t}`.toLowerCase();n.endsWith("s")&&(n=n.slice(0,-1));let e=1;const r=/^(?:(\d+)\s+)/.exec(n);switch(r&&(n=n.slice(r[0].length),e=+r[1]),n){case"quarter":n="month",e*=3;break;case"half":n="month",e*=6}let o=Jr.get(n);if(!o)throw new Error(`unknown interval: ${t}`);if(e>1&&!o.every)throw new Error(`non-periodic interval: ${n}`);return[n,e]}function oo(t){return ao(ro(t),"time")}function io(t){return ao(ro(t),"utc")}function ao([t,n],e){let r=("time"===e?Zr:Jr).get(t);return n>1&&(r=r.every(n),r[Kr]=Gr.get(t)*n,r[Qr]=e),r}function lo(t,n){if(!(n>1))return;const e=t[Kr];if(!Xr.some((([,t])=>t===e)))return;if(e%Vr==0&&VrMath.log(t))).center(Xr,Math.log(e*n))];return("time"===t[Qr]?oo:io)(r)}function so(t,n,e){const r="time"===n?T:R;if(null==e)return r("year"===t?"%Y":"month"===t?"%Y-%m":"day"===t?"%Y-%m-%d":"hour"===t||"minute"===t?"%Y-%m-%dT%H:%M":"second"===t?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M:%S.%L");const o=function(t){return"left"===t||"right"===t?(t,n)=>`\n${t}\n${n}`:"top"===t?(t,n)=>`${n}\n${t}`:(t,n)=>`${t}\n${n}`}(e);switch(t){case"millisecond":return uo(r(".%L"),r(":%M:%S"),o);case"second":return uo(r(":%S"),r("%-I:%M"),o);case"minute":return uo(r("%-I:%M"),r("%p"),o);case"hour":return uo(r("%-I %p"),r("%b %-d"),o);case"day":return uo(r("%-d"),r("%b"),o);case"month":return uo(r("%b"),r("%Y"),o);case"year":return r("%Y")}throw new Error("unable to format time ticks")}function co(t,n,e){const r=N(C(n,((t,n)=>Math.abs(n-t))));if(r<1e3)return so("millisecond","utc",e);for(const[o,i,a,l]of function(t){return"time"===t?no:"utc"===t?to:eo}(t)){if(r>l)break;if("hour"===o&&!r)break;if(n.every((t=>i.floor(t)>=t)))return so(o,a,e)}}function uo(t,n,e){return(r,o,i)=>{const a=t(r,o),l=n(r,o),s=o-Dr(i);return o!==s&&void 0!==i[s]&&l===n(i[s],s)?a:e(a,l)}}const fo=Object.getPrototypeOf(Uint8Array),ho=Object.prototype.toString,po=Symbol("reindex");function mo(t,n,e){const r=typeof n;return"string"===r?yo(t,xo(n),e):"function"===r?yo(t,n,e):"number"===r||n instanceof Date||"boolean"===r?Do(t,Oo(n),e):"function"==typeof n?.transform?go(n.transform(t),e):function(t,n){return n?Qo(t,n):t}(go(n,e),t?.[po])}function yo(t,n,e){return Do(t,e?.prototype instanceof fo?function(t){return(n,e)=>Co(t(n,e))}(n):n,e)}function go(t,n){return void 0===n?Fo(t):t instanceof n?t:n.prototype instanceof fo&&!(t instanceof fo)?n.from(t,Co):n.from(t)}const vo=[null],xo=t=>n=>n[t],wo={transform:Ko},bo={transform:t=>t},ko=()=>1,$o=()=>!0,Mo=t=>null==t?t:`${t}`,Lo=t=>null==t?t:+t,Ao=t=>t?t[0]:void 0,Eo=t=>t?t[1]:void 0,zo=t=>t?t[2]:void 0,Oo=t=>()=>t;function So(t){const n=+`${t}`.slice(1)/100;return(t,e)=>W(t,n,e)}function No(t){return t instanceof fo?t:Do(t,Co,Float64Array)}function Co(t){return null==t?NaN:Number(t)}function To(t){return Do(t,Ro)}function Ro(t){return t instanceof Date&&!isNaN(t)?t:"string"==typeof t?Sr(t):null==t||isNaN(t=+t)?void 0:new Date(t)}function Io(t,n){return void 0===t&&(t=n),null===t?[void 0,"none"]:$i(t)?[void 0,t]:[t,void 0]}function Wo(t,n){return void 0===t&&(t=n),null===t||"number"==typeof t?[void 0,t]:[t,void 0]}function jo(t,n,e){if(null!=t)return Bo(t,n,e)}function Bo(t,n,e){const r=`${t}`.toLowerCase();if(!e.includes(r))throw new Error(`invalid ${n}: ${t}`);return r}function Fo(t){return null==t||t instanceof Array||t instanceof fo?t:Array.from(t)}function Do(t,n,e=Array){return null==t?t:t instanceof e?t.map(n):e.from(t,n)}function qo(t,n=Array){return t instanceof n?t.slice():n.from(t)}function _o({x:t,x1:n,x2:e}){return void 0!==t||void 0!==n||void 0!==e}function Po({y:t,y1:n,y2:e}){return void 0!==t||void 0!==n||void 0!==e}function Vo(t){return _o(t)||Po(t)||void 0!==t.interval}function Ho(t){return t?.toString===ho}function Yo(t){return Ho(t)&&(void 0!==t.type||void 0!==t.domain)}function Uo(t){return Ho(t)&&"function"!=typeof t.transform}function Xo(t){return Uo(t)&&void 0===t.value&&void 0===t.channel}function Go(t,n,e,r=bo){return void 0===n&&void 0===e?(n=0,e=void 0===t?r:t):void 0===n?n=void 0===t?0:t:void 0===e&&(e=void 0===t?0:t),[n,e]}function Zo(t,n){return void 0===t&&void 0===n?[Ao,Eo]:[t,n]}function Jo({z:t,fill:n,stroke:e}={}){return void 0===t&&([t]=Io(n)),void 0===t&&([t]=Io(e)),t}function Ko(t){const n=t.length,e=new Uint32Array(n);for(let t=0;tt[n]),t.constructor)}function ti(t){return 1===t.length?(n,e)=>t(Qo(e,n)):t}function ni(t,n,e){return t.subarray?t.subarray(n,e):t.slice(n,e)}function ei(t){return null!==t&&"object"==typeof t?t.valueOf():t}function ri(t,n){if(void 0!==n[t])return n[t];switch(t){case"x1":case"x2":t="x";break;case"y1":case"y2":t="y"}return n[t]}function oi(t){let n;return[{transform:()=>n,label:ai(t)},t=>n=t]}function ii(t){return null==t?[t]:oi(t)}function ai(t,n){return"string"==typeof t?t:t&&void 0!==t.label?t.label:n}function li(t,n){return{transform(e){const r=t.transform(e),o=n.transform(e);return gi(r)||gi(o)?Do(r,((t,n)=>new Date((+r[n]+ +o[n])/2))):Do(r,((t,n)=>(+r[n]+ +o[n])/2),Float64Array)},label:t.label}}function si(t,n){const e=ci(n?.interval,n?.type);return e?Do(t,e):t}function ci(t,n){const e=ui(t,n);return e&&(t=>Tr(t)?e.floor(t):t)}function ui(t,n){if(null!=t){if("number"==typeof t){0Math.floor(t*n)/n,offset:t=>(t*n+1)/n,range:(t,e)=>I(Math.ceil(t*n),e*n).map((t=>t/n))}:{floor:t=>Math.floor(t/n)*n,offset:t=>t+n,range:(t,e)=>I(Math.ceil(t/n),e/n).map((t=>t*n))}}if("string"==typeof t)return("time"===n?oo:io)(t);if("function"!=typeof t.floor)throw new Error("invalid interval; missing floor method");if("function"!=typeof t.offset)throw new Error("invalid interval; missing offset method");return t}}function fi(t,n){if((t=ui(t,n))&&"function"!=typeof t.range)throw new Error("invalid interval: missing range method");return t}function hi(t){return"function"==typeof t?.range}function di(t){return void 0===t||Uo(t)?t:{value:t}}function pi(t){return t&&"function"==typeof t[Symbol.iterator]}function mi(t){for(const n of t)if(null!=n)return"object"!=typeof n||n instanceof Date}function yi(t){for(const n of t){if(null==n)continue;const t=typeof n;return"string"===t||"boolean"===t}}function gi(t){for(const n of t)if(null!=n)return n instanceof Date}function vi(t){for(const n of t)if(null!=n)return"string"==typeof n&&isNaN(n)&&Sr(n)}function xi(t){for(const n of t)if(null!=n){if("string"!=typeof n)return!1;if(n.trim())return!isNaN(n)}}function wi(t){for(const n of t)if(null!=n)return"number"==typeof n}function bi(t,n){let e;for(const r of t)if(null!=r){if(!n(r))return!1;e=!0}return e}const ki=new Set("none,currentcolor,transparent,aliceblue,antiquewhite,aqua,aquamarine,azure,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,cadetblue,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkgrey,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkslategrey,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dimgrey,dodgerblue,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,green,greenyellow,grey,honeydew,hotpink,indianred,indigo,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgray,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightslategrey,lightsteelblue,lightyellow,lime,limegreen,linen,magenta,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,rebeccapurple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,seagreen,seashell,sienna,silver,skyblue,slateblue,slategray,slategrey,snow,springgreen,steelblue,tan,teal,thistle,tomato,turquoise,violet,wheat,white,whitesmoke,yellow".split(","));function $i(t){return"string"==typeof t&&(t=t.toLowerCase().trim(),/^#[0-9a-f]{3,8}$/.test(t)||/^(?:url|var|rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix)\(.*\)$/.test(t)||ki.has(t))}function Mi(t){return"number"==typeof t&&(0<=t&&t<=1||isNaN(t))}function Li(t){return null==t||Ai(t)}function Ai(t){return/^\s*none\s*$/i.test(t)}function Ei(t,n){return jo(t,n,["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function zi(t="middle"){return Ei(t,"frameAnchor")}function Oi(t){return pi(t)?function(t){console.warn("named iterables are deprecated; please use an object instead");const n=new Set;return Object.fromEntries(Array.from(t,(t=>{const{name:e}=t;if(null==e)throw new Error("missing name");const r=`${e}`;if("__proto__"===r)throw new Error(`illegal name: ${r}`);if(n.has(r))throw new Error(`duplicate name: ${r}`);return n.add(r),[e,t]})))}(t):t}function Si(t){return!0===t?t="frame":!1===t?t=null:null!=t&&(t=Bo(t,"clip",["frame","sphere"])),t}const Ni=Symbol("position"),Ci=Symbol("color"),Ti=Symbol("radius"),Ri=Symbol("length"),Ii=Symbol("opacity"),Wi=Symbol("symbol"),ji=Symbol("projection"),Bi=new Map([["x",Ni],["y",Ni],["fx",Ni],["fy",Ni],["r",Ti],["color",Ci],["opacity",Ii],["symbol",Wi],["length",Ri],["projection",ji]]);const Fi=Math.sqrt(3),Di=2/Fi,qi=new Map([["asterisk",j],["circle",B],["cross",F],["diamond",D],["diamond2",q],["hexagon",{draw(t,n){const e=Math.sqrt(n/Math.PI),r=e*Di,o=r/2;t.moveTo(0,r),t.lineTo(e,o),t.lineTo(e,-o),t.lineTo(0,-r),t.lineTo(-e,-o),t.lineTo(-e,o),t.closePath()}}],["plus",_],["square",P],["square2",V],["star",H],["times",Y],["triangle",U],["triangle2",X],["wye",G]]);function _i(t){return t&&"function"==typeof t.draw}function Pi(t){return!!_i(t)||"string"==typeof t&&qi.has(t.toLowerCase())}function Vi(t){if(null==t||_i(t))return t;const n=qi.get(`${t}`.toLowerCase());if(n)return n;throw new Error(`invalid symbol: ${t}`)}function Hi({filter:t,sort:n,reverse:e,transform:r,initializer:o,...i}={},a){if(void 0===r&&(null!=t&&(r=Ji(t)),null==n||Xo(n)||(r=Ui(r,ea(n))),e&&(r=Ui(r,Qi))),null!=a&&null!=o)throw new Error("transforms cannot be applied after initializers");return{...i,...(null===n||Xo(n))&&{sort:n},transform:Ui(r,a)}}function Yi({filter:t,sort:n,reverse:e,initializer:r,...o}={},i){return void 0===r&&(null!=t&&(r=Ji(t)),null==n||Xo(n)||(r=Xi(r,ea(n))),e&&(r=Xi(r,Qi))),{...o,...(null===n||Xo(n))&&{sort:n},initializer:Xi(r,i)}}function Ui(t,n){return null==t?null===n?void 0:n:null==n?null===t?void 0:t:function(e,r,o){return({data:e,facets:r}=t.call(this,e,r,o)),n.call(this,Fo(e),r,o)}}function Xi(t,n){return null==t?null===n?void 0:n:null==n?null===t?void 0:t:function(e,r,o,...i){let a,l,s,c,u,f;return({data:l=e,facets:s=r,channels:a}=t.call(this,e,r,o,...i)),({data:u=l,facets:f=s,channels:c}=n.call(this,l,s,{...o,...a},...i)),{data:u,facets:f,channels:{...a,...c}}}}function Gi(t,n){return(null!=t.initializer?Yi:Hi)(t,n)}function Zi(t,n){return Gi(n,Ji(t))}function Ji(t){return(n,e)=>{const r=mo(n,t);return{data:n,facets:e.map((t=>t.filter((t=>r[t]))))}}}function Ki({sort:t,...n}={}){return{...Gi(n,Qi),sort:Xo(t)?t:null}}function Qi(t,n){return{data:t,facets:n.map((t=>t.slice().reverse()))}}function ta({seed:t,sort:n,...e}={}){return{...Gi(e,oa(null==t?Math.random:Z(t))),sort:Xo(n)?n:null}}function na(t,{sort:n,...e}={}){return{...(Uo(t)&&void 0!==t.channel?Yi:Gi)(e,ea(t)),sort:Xo(n)?n:null}}function ea(t){return("function"==typeof t&&1!==t.length?ra:oa)(t)}function ra(t){return(n,e)=>{const r=(e,r)=>t(n[e],n[r]);return{data:n,facets:e.map((t=>t.slice().sort(r)))}}}function oa(t){let n,e;({channel:n,value:t,order:e}={...di(t)});const r=n?.startsWith("-");if(r&&(n=n.slice(1)),void 0===e&&(e=r?Ir:Rr),"function"!=typeof e)switch(`${e}`.toLowerCase()){case"ascending":e=Rr;break;case"descending":e=Ir;break;default:throw new Error(`invalid order: ${e}`)}return(r,o,i)=>{let a;if(void 0===n)a=mo(r,t);else{if(void 0===i)throw new Error("channel sort requires an initializer");if(a=i[n],!a)return{};a=a.value}const l=(t,n)=>e(a[t],a[n]);return{data:r,facets:o.map((t=>t.slice().sort(l)))}}}function ia(t,n){return ca(null,null,t,n)}function aa(t={y:"count"},n={}){const{x:e=bo}=n;if(null==e)throw new Error("missing channel: x");return ca(e,null,t,n)}function la(t={x:"count"},n={}){const{y:e=bo}=n;if(null==e)throw new Error("missing channel: y");return ca(null,e,t,n)}function sa(t={fill:"count"},n={}){let{x:e,y:r}=n;if([e,r]=Zo(e,r),null==e)throw new Error("missing channel: x");if(null==r)throw new Error("missing channel: y");return ca(e,r,t,n)}function ca(t,n,{data:e=Aa,filter:r,sort:o,reverse:i,...a}={},l={}){a=ga(a,l),e=wa(e,bo),o=null==o?void 0:va("sort",o,l),r=null==r?void 0:xa("filter",r,l);const[s,c]=ii(t),[u,f]=ii(n),{z:h,fill:d,stroke:p,x1:m,x2:y,y1:g,y2:v,...x}=l,[w,b]=ii(h),[k]=Io(d),[$]=Io(p),[M,L]=ii(k),[A,E]=ii($);return{..."z"in l&&{z:w||h},..."fill"in l&&{fill:M||d},..."stroke"in l&&{stroke:A||p},...Hi(x,((l,s,u)=>{const d=si(mo(l,t),u?.x),p=si(mo(l,n),u?.y),m=mo(l,h),y=mo(l,k),g=mo(l,$),v=ka(a,{z:m,fill:y,stroke:g}),x=[],w=[],M=d&&c([]),A=p&&f([]),z=m&&b([]),O=y&&L([]),S=g&&E([]);let N=0;for(const t of a)t.initialize(l);o&&o.initialize(l),r&&r.initialize(l);for(const t of s){const n=[];for(const n of a)n.scope("facet",t);o&&o.scope("facet",t),r&&r.scope("facet",t);for(const[i,s]of pa(t,v))for(const[t,c]of pa(s,p))for(const[s,u]of pa(c,d)){const c={data:l};if(d&&(c.x=s),p&&(c.y=t),v&&(c.z=i),!r||r.reduce(u,c)){n.push(N++),w.push(e.reduceIndex(u,l,c)),d&&M.push(s),p&&A.push(t),m&&z.push(v===m?i:m[u[0]]),y&&O.push(v===y?i:y[u[0]]),g&&S.push(v===g?i:g[u[0]]);for(const t of a)t.reduce(u,c);o&&o.reduce(u,c)}}x.push(n)}return $a(x,o,i),{data:w,facets:x}})),...!ua(a,"x")&&(s?{x:s}:{x1:m,x2:y}),...!ua(a,"y")&&(u?{y:u}:{y1:g,y2:v}),...Object.fromEntries(a.map((({name:t,output:n})=>[t,n])))}}function ua(t,...n){for(const{name:e}of t)if(n.includes(e))return!0;return!1}function fa(t,n,e=ha){const r=Object.entries(t);return null!=n.title&&void 0===t.title&&r.push(["title",za]),null!=n.href&&void 0===t.href&&r.push(["href",Ea]),r.filter((([,t])=>void 0!==t)).map((([t,r])=>null===r?function(t){return{name:t,initialize(){},scope(){},reduce(){}}}(t):e(t,r,n)))}function ha(t,n,e,r=da){let o;Ho(n)&&"reduce"in n&&(o=n.scale,n=n.reduce);const i=r(t,n,e),[a,l]=oi(i.label);let s;return{name:t,output:void 0===o?a:{value:a,scale:o},initialize(t){i.initialize(t),s=l([])},scope(t,n){i.scope(t,n)},reduce(t,n){s.push(i.reduce(t,n))}}}function da(t,n,e,r=ma){const o=ri(t,e),i=r(n,o);let a,l;return{label:ai(i===Sa?null:o,i.label),initialize(t){a=void 0===o?t:mo(t,o),"data"===i.scope&&(l=i.reduceIndex(Ko(t),a))},scope(t,n){i.scope===t&&(l=i.reduceIndex(n,a))},reduce:(t,n)=>null==i.scope?i.reduceIndex(t,a,n):i.reduceIndex(t,a,l,n)}}function pa(t,n){return n?J(t,(t=>n[t])):[[,t]]}function ma(t,n,e=ya){if(null==t)return e(t);if("function"==typeof t.reduceIndex)return t;if("function"==typeof t.reduce&&Ho(t))return function(t){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...t,reduceIndex:t.reduce.bind(t)}}(t);if("function"==typeof t)return r=t,{reduceIndex:(t,n,e)=>r(Qo(n,t),e)};var r;if(/^p\d{2}$/i.test(t))return Ma(So(t));switch(`${t}`.toLowerCase()){case"first":return Ea;case"last":return Oa;case"identity":return Aa;case"count":return Sa;case"distinct":return Na;case"sum":return null==n?Sa:Ca;case"proportion":return Ta(n,"data");case"proportion-facet":return Ta(n,"facet");case"deviation":return Ma(ut);case"min":return Ma(ct);case"min-index":return Ma(st);case"max":return Ma(N);case"max-index":return Ma(lt);case"mean":return La(at);case"median":return La(ot);case"variance":return Ma(rt);case"mode":return Ma(et)}return e(t)}function ya(t){throw new Error(`invalid reduce: ${t}`)}function ga(t,n){return fa(t,n,va)}function va(t,n,e){return ha(t,n,e,xa)}function xa(t,n,e){return da(t,n,e,wa)}function wa(t,n){return ma(t,n,ba)}function ba(t){switch(`${t}`.toLowerCase()){case"x":return Ra;case"y":return Ia;case"z":return Wa}throw new Error(`invalid group reduce: ${t}`)}function ka(t,n){for(const e in n){const r=n[e];if(void 0!==r&&!t.some((t=>t.name===e)))return r}}function $a(t,n,e){if(n){const e=n.output.transform(),r=(t,n)=>Rr(e[t],e[n]);t.forEach((t=>t.sort(r)))}e&&t.forEach((t=>t.reverse()))}function Ma(t){return{reduceIndex:(n,e)=>t(n,(t=>e[t]))}}function La(t){return{reduceIndex(n,e){const r=t(n,(t=>e[t]));return gi(e)?new Date(r):r}}}const Aa={reduceIndex:(t,n)=>Qo(n,t)},Ea={reduceIndex:(t,n)=>n[t[0]]},za={reduceIndex(t,n){const e=K(Q(t,(t=>t.length),(t=>n[t])),Eo),r=e.slice(-5).reverse();if(r.length`${t} (${n.toLocaleString("en-US")})`)).join("\n")}},Oa={reduceIndex:(t,n)=>n[t[t.length-1]]},Sa={label:"Frequency",reduceIndex:t=>t.length},Na={label:"Distinct",reduceIndex(t,n){const e=new nt;for(const r of t)e.add(n[r]);return e.size}},Ca=Ma(tt);function Ta(t,n){return null==t?{scope:n,label:"Frequency",reduceIndex:(t,n,e=1)=>t.length/e}:{scope:n,reduceIndex:(t,n,e=1)=>tt(t,(t=>n[t]))/e}}const Ra={reduceIndex:(t,n,{x:e})=>e},Ia={reduceIndex:(t,n,{y:e})=>e},Wa={reduceIndex:(t,n,{z:e})=>e};function ja(t){if("function"!=typeof t)throw new Error(`invalid test function: ${t}`);return{reduceIndex:(n,e,{data:r})=>e[n.find((n=>t(r[n],n,r)))]}}function Ba(t,{scale:n,type:e,value:r,filter:o,hint:i,label:a=ai(r)},l){return void 0===i&&"function"==typeof r?.transform&&(i=r.hint),qa(l,{scale:n,type:e,value:mo(t,r),label:a,filter:o,hint:i})}function Fa(t,n){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,Ba(n,e,t)])))}function Da(t,n){const e=Object.fromEntries(Object.entries(t).map((([t,{scale:e,value:r}])=>{const o=null==e?null:n[e];return[t,null==o?r:Do(r,o)]})));return e.channels=t,e}function qa(t,n){const{scale:e,value:r}=n;if(!0===e||"auto"===e)switch(t){case"fill":case"stroke":case"color":n.scale=!0!==e&&bi(r,$i)?null:"color";break;case"fillOpacity":case"strokeOpacity":case"opacity":n.scale=!0!==e&&bi(r,Mi)?null:"opacity";break;case"symbol":!0!==e&&bi(r,Pi)?(n.scale=null,n.value=Do(r,Vi)):n.scale="symbol";break;default:n.scale=Bi.has(t)?t:null}else if(!1===e)n.scale=null;else if(null!=e&&!Bi.has(e))throw new Error(`unknown scale: ${e}`);return n}function _a(t,n){for(const e in t){const r=t[e];if(r.scale===n)return r}}function Pa(t,n){const e=t.original;if(e===t)return n;const r=n.value,o=n.value=[];for(let n=0;nMath.abs(t-r[n])),Float64Array)}function Ha(t,n,e){let r=t[n];if(r||void 0===e||(r=t[e]),r)return r.value;throw new Error(`missing channel: ${n}`)}function Ya(t){if(null==t||"function"==typeof t)return t;switch(`${t}`.toLowerCase()){case"ascending":return Ua;case"descending":return Xa}throw new Error(`invalid order: ${t}`)}function Ua([t,n],[e,r]){return Rr(n,r)||Rr(t,e)}function Xa([t,n],[e,r]){return Ir(n,r)||Rr(t,e)}function Ga(t,n){let e=t[n];if(e){for(;e.source;)e=e.source;return null===e.source?null:e}}function Za(t={}){const{document:n=("undefined"!=typeof window?window.document:void 0),clip:e}=t;return{document:n,clip:Si(e)}}function Ja(t,{document:n}){return ht(dt(t).call(n.documentElement))}let Ka,Qa=0;function tl(t){t!==Ka&&(Ka=t,console.warn(t),++Qa)}const nl=Math.PI,el=2*nl,rl=.618;function ol({projection:t,inset:n=0,insetTop:e=n,insetRight:r=n,insetBottom:o=n,insetLeft:i=n}={},a){if(null==t)return;if("function"==typeof t.stream)return t;let l,s,c="frame";if(Ho(t)){let n;if(({type:t,domain:s,inset:n,insetTop:e=(void 0!==n?n:e),insetRight:r=(void 0!==n?n:r),insetBottom:o=(void 0!==n?n:o),insetLeft:i=(void 0!==n?n:i),clip:c=c,...l}=t),null==t)return}"function"!=typeof t&&({type:t}=il(t));const{width:u,height:f,marginLeft:h,marginRight:d,marginTop:p,marginBottom:m}=a,y=u-h-d-i-r,g=f-p-m-e-o;if(t=t?.({width:y,height:g,clip:c,...l}),null==t)return;c=function(t,n,e,r,o){if(!1===t||null==t||"number"==typeof t)return t=>t;!0===t&&(t="frame");if("frame"===`${t}`.toLowerCase())return yt(n,e,r,o);throw new Error(`unknown projection clip type: ${t}`)}(c,h,p,u-d,f-m);let v,x=h+i,w=p+e;if(null!=s){const[[n,e],[r,o]]=mt(t).bounds(s),i=Math.min(y/(r-n),g/(o-e));i>0?(x-=(i*(n+r)-y)/2,w-=(i*(e+o)-g)/2,v=pt({point(t,n){this.stream.point(t*i+x,n*i+w)}})):tl("Warning: the projection could not be fit to the specified domain; using the default scale.")}return v??=0===x&&0===w?sl():pt({point(t,n){this.stream.point(t+x,n+w)}}),{stream:n=>t.stream(v.stream(c(n)))}}function il(t){switch(`${t}`.toLowerCase()){case"albers-usa":return al(Et,.7463,.4673);case"albers":return ll(Nt,.7463,.4673);case"azimuthal-equal-area":return al(At,4,4);case"azimuthal-equidistant":return al(Lt,el,el);case"conic-conformal":return ll(St,el,el);case"conic-equal-area":return ll(Ot,6.1702,2.9781);case"conic-equidistant":return ll(zt,7.312,3.6282);case"equal-earth":return al(Mt,5.4133,2.6347);case"equirectangular":return al($t,el,nl);case"gnomonic":return al(kt,3.4641,3.4641);case"identity":return{type:sl};case"reflect-y":return{type:cl};case"mercator":return al(bt,el,el);case"orthographic":return al(wt,2,2);case"stereographic":return al(xt,2,2);case"transverse-mercator":return al(vt,el,el);default:throw new Error(`unknown projection type: ${t}`)}}function al(t,n,e){return{type:({width:r,height:o,rotate:i,precision:a=.15,clip:l})=>{const s=t();return null!=a&&s.precision?.(a),null!=i&&s.rotate?.(i),"number"==typeof l&&s.clipAngle?.(l),s.scale(Math.min(r/n,o/e)),s.translate([r/2,o/2]),s},aspectRatio:e/n}}function ll(t,n,e){const{type:r,aspectRatio:o}=al(t,n,e);return{type:t=>{const{parallels:n,domain:e,width:o,height:i}=t,a=r(t);return null!=n&&(a.parallels(n),void 0===e&&a.fitSize([o,i],{type:"Sphere"})),a},aspectRatio:o}}const sl=Oo({stream:t=>t}),cl=Oo(pt({point(t,n){this.stream.point(t,-n)}}));function ul(t,n,e,r){const o=e[t],i=e[n],a=o.length,l=e[t]=new Float64Array(a).fill(NaN),s=e[n]=new Float64Array(a).fill(NaN);let c;const u=r.stream({point(t,n){l[c]=t,s[c]=n}});for(c=0;c1===e?[t[3][1]]:2===e?[t[3][1],t[3][2]]:(e=Math.max(3,Math.floor(e)))>9?Ct(n,e):t[e]}function gl(t,n){return({length:e})=>2===e?[t[3][0],t[3][2]]:(e=Math.max(3,Math.floor(e)))>11?Ct(n,e):t[e]}function vl(t,n){return({length:e})=>2===e?[t[3][2],t[3][0]]:(e=Math.max(3,Math.floor(e)))>11?Ct((t=>n(1-t)),e):t[e].slice().reverse()}function xl(t){return({length:n})=>Ct(t,Math.max(2,Math.floor(n)))}function wl(t){return({length:n})=>Ct(t,Math.floor(n)+1).slice(0,-1)}function bl(t){const n=`${t}`.toLowerCase();if(!ml.has(n))throw new Error(`unknown ordinal scheme: ${n}`);return ml.get(n)}function kl(t,n){const e=bl(t),r="function"==typeof e?e({length:n}):e;return r.length!==n?r.slice(0,n):r}const $l=new Map([["brbg",Vt],["prgn",Yt],["piyg",Xt],["puor",Zt],["rdbu",Kt],["rdgy",tn],["rdylbu",en],["rdylgn",on],["spectral",ln],["burd",t=>Kt(1-t)],["buylrd",t=>en(1-t)],["blues",cn],["greens",fn],["greys",dn],["purples",gn],["reds",xn],["oranges",mn],["turbo",bn],["viridis",kn],["magma",$n],["inferno",Mn],["plasma",Ln],["cividis",An],["cubehelix",En],["warm",zn],["cool",On],["bugn",Sn],["bupu",Cn],["gnbu",Rn],["orrd",Wn],["pubugn",Dn],["pubu",Bn],["purd",_n],["rdpu",Vn],["ylgnbu",Xn],["ylgn",Yn],["ylorbr",Zn],["ylorrd",Kn],["rainbow",te],["sinebow",ne]]);function Ml(t){const n=`${t}`.toLowerCase();if(!$l.has(n))throw new Error(`unknown quantitative scheme: ${n}`);return $l.get(n)}const Ll=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);const Al=t=>n=>t(1-n),El=[0,1],zl=new Map([["number",ce],["rgb",pe],["hsl",ye],["hcl",ge],["lab",ve]]);function Ol(t){const n=`${t}`.toLowerCase();if(!zl.has(n))throw new Error(`unknown interpolator: ${n}`);return zl.get(n)}function Sl(t,n,e,{type:r,nice:o,clamp:i,zero:a,domain:l=Rl(t,e),unknown:s,round:c,scheme:u,interval:f,range:h=(Bi.get(t)===Ti?Wl(e,l):Bi.get(t)===Ri?jl(e,l):Bi.get(t)===Ii?El:void 0),interpolate:d=(Bi.get(t)===Ci?null==u&&void 0!==h?pe:Ml(void 0!==u?u:"cyclical"===r?"rainbow":"turbo"):c?me:ce),reverse:p}){if(f=fi(f,r),"cyclical"!==r&&"sequential"!==r||(r="linear"),"function"!=typeof d&&(d=Ol(d)),p=!!p,void 0!==h){if((l=Fo(l)).length!==(h=Fo(h)).length){if(1===d.length)throw new Error("invalid piecewise interpolator");d=de(d,h),h=void 0}}if(1===d.length?(p&&(d=Al(d),p=!1),void 0===h&&2===(h=Float64Array.from(l,((t,n)=>n/(l.length-1)))).length&&(h=El),n.interpolate((h===El?Oo:Dl)(d))):n.interpolate(d),a){const[t,n]=le(l);(t>0||n<0)&&(Dr(l=qo(l))!==Math.sign(t)?l[l.length-1]=0:l[0]=0)}return p&&(l=ue(l)),n.domain(l).unknown(s),o&&(n.nice(function(t,n){return!0===t?void 0:"number"==typeof t?t:function(t,n){if((t=fi(t,n))&&"function"!=typeof t.ceil)throw new Error("invalid interval: missing ceil method");return t}(t,n)}(o,r)),l=n.domain()),void 0!==h&&n.range(h),i&&n.clamp(i),{type:r,domain:l,range:h,scale:n,interpolate:d,interval:f}}function Nl(t,n,{exponent:e=1,...r}){return Sl(t,re().exponent(e),n,{...r,type:"pow"})}function Cl(t,e,{domain:r=[0],unknown:o,scheme:i="rdylbu",interpolate:a,range:l=(void 0!==a?Ct(a,r.length+1):Bi.get(t)===Ci?kl(i,r.length+1):void 0),reverse:s}){const c=Dr(r=Fo(r));if(!isNaN(c)&&!function(t,e){for(let r=1,o=t.length,i=t[0];rvoid 0===t?t:ct(t,n))),N(t,(({value:t})=>void 0===t?t:N(t,n)))]:[0,1]}function Rl(t,n){const e=Bi.get(t);return(e===Ti||e===Ii||e===Ri?Il:Tl)(n)}function Il(t){return[0,t.length?N(t,(({value:t})=>void 0===t?t:N(t,jr))):1]}function Wl(t,n){const e=t.find((({radius:t})=>void 0!==t));if(void 0!==e)return[0,e.radius];const r=W(t,.5,(({value:t})=>void 0===t?NaN:W(t,.25,Br))),o=n.map((t=>3*Math.sqrt(t/r))),i=30/N(o);return i<1?o.map((t=>t*i)):o}function jl(t,n){const e=ot(t,(({value:t})=>void 0===t?NaN:ot(t,Math.abs))),r=n.map((t=>12*t/e)),o=60/N(r);return o<1?r.map((t=>t*o)):r}function Bl(t){for(const{value:n}of t)if(void 0!==n)for(let e of n){if(e>0)return Tl(t,Br);if(e<0)return Tl(t,Fr)}return[1,10]}function Fl(t){const n=[];for(const{value:e}of t)if(void 0!==e)for(const t of e)n.push(t);return n}function Dl(t){return(n,e)=>r=>t(n+r*(e-n))}function ql(t,e,r,o,{type:i,nice:a,clamp:l,domain:s=Tl(o),unknown:c,pivot:u=0,scheme:f,range:h,symmetric:d=!0,interpolate:p=(Bi.get(t)===Ci?null==f&&void 0!==h?pe:Ml(void 0!==f?f:"rdbu"):ce),reverse:m}){u=+u,s=Fo(s);let[y,g]=s;if(s.length>2&&tl(`Warning: the diverging ${t} scale domain contains extra elements.`),n(y,g)<0&&([y,g]=[g,y],m=!m),y=Math.min(y,u),g=Math.max(g,u),"function"!=typeof p&&(p=Ol(p)),void 0!==h&&(p=1===p.length?Dl(p)(...h):de(p,h)),m&&(p=Al(p)),d){const t=r.apply(u),n=t-r.apply(y),e=r.apply(g)-t;ne&&(g=r.invert(t+n))}return e.domain([y,u,g]).unknown(c).interpolator(p),l&&e.clamp(l),a&&e.nice(a),{type:i,domain:[y,g],pivot:u,interpolate:p,scale:e}}function _l(t,n,{exponent:e=1,...r}){return ql(t,we().exponent(e=+e),function(t){return.5===t?Yl:{apply:n=>Math.sign(n)*Math.pow(Math.abs(n),t),invert:n=>Math.sign(n)*Math.pow(Math.abs(n),1/t)}}(e),n,{...r,type:"diverging-pow"})}function Pl(t,n,{constant:e=1,...r}){return ql(t,ke().constant(e=+e),function(t){return{apply:n=>Math.sign(n)*Math.log1p(Math.abs(n/t)),invert:n=>Math.sign(n)*Math.expm1(Math.abs(n))*t}}(e),n,r)}const Vl={apply:t=>t,invert:t=>t},Hl={apply:Math.log,invert:Math.exp},Yl={apply:t=>Math.sign(t)*Math.sqrt(Math.abs(t)),invert:t=>Math.sign(t)*(t*t)};function Ul(t,n,e,r){return Sl(t,n,e,r)}const Xl=Symbol("ordinal");function Gl(t,n,e,{type:r,interval:o,domain:i,range:a,reverse:l,hint:s}){return o=fi(o,r),void 0===i&&(i=Kl(e,o,t)),"categorical"!==r&&r!==Xl||(r="ordinal"),l&&(i=ue(i)),i=n.domain(i).domain(),void 0!==a&&("function"==typeof a&&(a=a(i)),n.range(a)),{type:r,domain:i,range:a,scale:n,hint:s,interval:o}}function Zl(t,n,{type:e,interval:r,domain:o,range:i,scheme:a,unknown:l,...s}){let c;if(r=fi(r,e),void 0===o&&(o=Kl(n,r,t)),Bi.get(t)===Wi)c=function(t){return{fill:Ql(t,"fill"),stroke:Ql(t,"stroke")}}(n),i=void 0===i?function(t){return Li(t.fill)?Oe:Se}(c):Do(i,Vi);else if(Bi.get(t)===Ci&&(void 0!==i||"ordinal"!==e&&e!==Xl||(i=function(t,n="greys"){const e=new Set,[r,o]=kl(n,2);for(const n of t)if(null!=n)if(!0===n)e.add(o);else{if(!1!==n)return;e.add(r)}return[...e]}(o,a),void 0!==i&&(a=void 0)),void 0===a&&void 0===i&&(a="ordinal"===e?"turbo":"observable10"),void 0!==a))if(void 0!==i){const t=Ml(a),n=i[0],e=i[1]-i[0];i=({length:r})=>Ct((r=>t(n+e*r)),r)}else i=bl(a);if(l===Le)throw new Error(`implicit unknown on ${t} scale is not supported`);return Gl(t,Ae().unknown(l),n,{...s,type:e,domain:o,range:i,hint:c})}function Jl(t,n,e,r){let{round:o}=e;return void 0!==o&&t.round(o=!!o),(t=Gl(r,t,n,e)).round=o,t}function Kl(t,n,e){const r=new nt;for(const{value:n,domain:e}of t){if(void 0!==e)return e();if(void 0!==n)for(const t of n)r.add(t)}if(void 0!==n){const[t,e]=le(r).map(n.floor,n);return n.range(t,n.offset(e))}if(r.size>1e4&&Bi.get(e)===Ni)throw new Error(`implicit ordinal domain of ${e} scale has more than 10,000 values`);return K(r,Rr)}function Ql(t,n){let e;for(const{hint:r}of t){const t=r?.[n];if(void 0!==t)if(void 0===e)e=t;else if(e!==t)return}return e}function ts(t,{label:n,inset:e=0,insetTop:r=e,insetRight:o=e,insetBottom:i=e,insetLeft:a=e,round:l,nice:s,clamp:c,zero:u,align:f,padding:h,projection:d,facet:{label:p=n}={},...m}={}){const y={};for(const[e,g]of t){const t=m[e],v=fs(e,g,{round:Bi.get(e)===Ni?l:void 0,nice:s,clamp:c,zero:u,align:f,padding:h,projection:d,...t});if(v){let{label:l=("fx"===e||"fy"===e?p:n),percent:s,transform:c,inset:u,insetTop:f=(void 0!==u?u:"y"===e?r:0),insetRight:h=(void 0!==u?u:"x"===e?o:0),insetBottom:d=(void 0!==u?u:"y"===e?i:0),insetLeft:m=(void 0!==u?u:"x"===e?a:0)}=t||{};if(null==c)c=void 0;else if("function"!=typeof c)throw new Error("invalid scale transform; not a function");v.percent=!!s,v.label=void 0===l?es(g,v):l,v.transform=c,"x"===e||"fx"===e?(v.insetLeft=+m,v.insetRight=+h):"y"!==e&&"fy"!==e||(v.insetTop=+f,v.insetBottom=+d),y[e]=v}}return y}function ns(t){const n={},e={scales:n};for(const[r,o]of Object.entries(t)){const{scale:t,type:i,interval:a,label:l}=o;n[r]=ks(o),e[r]=t,t.type=i,null!=a&&(t.interval=a),null!=l&&(t.label=l)}return e}function es(t=[],n){let e;for(const{label:n}of t)if(void 0!==n)if(void 0===e)e=n;else if(e!==n)return;if(void 0!==e)return!ys(n)&&n.percent&&(e=`${e} (%)`),{inferred:!0,toString:()=>e}}function rs(t){return Math.sign(Dr(t.domain()))*Math.sign(Dr(t.range()))}function os(t){const{marginTop:n,marginRight:e,marginBottom:r,marginLeft:o,width:i,height:a,facet:{marginTop:l,marginRight:s,marginBottom:c,marginLeft:u}}=t;return{marginTop:Math.max(n,l),marginRight:Math.max(e,s),marginBottom:Math.max(r,c),marginLeft:Math.max(o,u),width:i,height:a}}function is({fx:t,fy:n},e){const{marginTop:r,marginRight:o,marginBottom:i,marginLeft:a,width:l,height:s}=os(e);return{marginTop:r,marginRight:o,marginBottom:i,marginLeft:a,width:t?t.scale.bandwidth()+a+o:l,height:n?n.scale.bandwidth()+r+i:s,facet:{width:l,height:s}}}function as(t,n){if(void 0===t.range){const{insetLeft:e,insetRight:r}=t,{width:o,marginLeft:i=0,marginRight:a=0}=n,l=i+e,s=o-a-r;t.range=[l,Math.max(l,s)],ys(t)||(t.range=cs(t)),t.scale.range(t.range)}ss(t)}function ls(t,n){if(void 0===t.range){const{insetTop:e,insetBottom:r}=t,{height:o,marginTop:i=0,marginBottom:a=0}=n,l=i+e,s=o-a-r;t.range=[Math.max(l,s),l],ys(t)?t.range.reverse():t.range=cs(t),t.scale.range(t.range)}ss(t)}function ss(t){void 0===t.round&&function({type:t}){return"point"===t||"band"===t}(t)&&function({scale:t}){const n=t.domain().length,[e,r]=t.range(),o=t.paddingInner?t.paddingInner():1,i=t.paddingOuter?t.paddingOuter():t.padding(),a=n-o,l=Math.abs(r-e)/Math.max(1,a+2*i);return(l-Math.floor(l))*a}(t)<=30&&t.scale.round(!0)}function cs(t){const n=t.scale.domain().length+gs(t);if(!(n>2))return t.range;const[e,r]=t.range;return Array.from({length:n},((t,o)=>e+o/(n-1)*(r-e)))}function us(t,n,e){return fs(t,void 0===e?void 0:[{hint:e}],{...n})}function fs(t,n=[],e={}){const r=function(t,n,{type:e,domain:r,range:o,scheme:i,pivot:a,projection:l}){if(e=ds(e),"fx"===t||"fy"===t)return"band";"x"!==t&&"y"!==t||null==l||(e=ps);for(const t of n){const n=ds(t.type);if(void 0!==n)if(void 0===e)e=n;else if(e!==n)throw new Error(`scale incompatible with channel: ${e} !== ${n}`)}if(e===ps)return;if(void 0!==e)return e;if(void 0===r&&!n.some((({value:t})=>void 0!==t)))return;const s=Bi.get(t);if(s===Ti)return"sqrt";if(s===Ii||s===Ri)return"linear";if(s===Wi)return"ordinal";if((r||o||[]).length>2)return ms(s);if(void 0!==r){if(yi(r))return ms(s);if(gi(r))return"utc"}else{const t=n.map((({value:t})=>t)).filter((t=>void 0!==t));if(t.some(yi))return ms(s);if(t.some(gi))return"utc"}if(s===Ci){if(null!=a||function(t){return null!=t&&Ll.has(`${t}`.toLowerCase())}(i))return"diverging";if(function(t){return null!=t&&pl.has(`${t}`.toLowerCase())}(i))return"categorical"}return"linear"}(t,n,e);if(void 0===e.type&&void 0===e.domain&&void 0===e.range&&null==e.interval&&"fx"!==t&&"fy"!==t&&ys({type:r})){const e=n.map((({value:t})=>t)).filter((t=>void 0!==t));e.some(gi)?tl(`Warning: some data associated with the ${t} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${hs(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${t} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${t} scale to "${hs(r)}".`):e.some(vi)?tl(`Warning: some data associated with the ${t} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a "utc" or "time" scale rather than a "${hs(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${t} scale to "${hs(r)}".`):e.some(xi)&&tl(`Warning: some data associated with the ${t} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "${hs(r)}" scale. If you want to treat this data as ordinal, you can specify the interval of the ${t} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${t} scale to "${hs(r)}".`)}switch(e.type=r,r){case"diverging":case"diverging-sqrt":case"diverging-pow":case"diverging-log":case"diverging-symlog":case"cyclical":case"sequential":case"linear":case"sqrt":case"threshold":case"quantile":case"pow":case"log":case"symlog":e=xs(n,e,No);break;case"identity":switch(Bi.get(t)){case Ni:e=xs(n,e,No);break;case Wi:e=xs(n,e,ws)}break;case"utc":case"time":e=xs(n,e,To)}switch(r){case"diverging":return function(t,n,e){return ql(t,xe(),Vl,n,e)}(t,n,e);case"diverging-sqrt":return function(t,n,e){return _l(t,n,{...e,exponent:.5})}(t,n,e);case"diverging-pow":return _l(t,n,e);case"diverging-log":return function(t,n,{base:e=10,pivot:r=1,domain:o=Tl(n,r<0?Fr:Br),...i}){return ql(t,be().base(e=+e),Hl,n,{domain:o,pivot:r,...i})}(t,n,e);case"diverging-symlog":return Pl(t,n,e);case"categorical":case"ordinal":case Xl:return Zl(t,n,e);case"cyclical":case"sequential":case"linear":return function(t,n,e){return Sl(t,ee(),n,e)}(t,n,e);case"sqrt":return function(t,n,e){return Nl(t,n,{...e,exponent:.5})}(t,n,e);case"threshold":return Cl(t,0,e);case"quantile":return function(t,n,{range:e,quantiles:r=(void 0===e?5:(e=[...e]).length),n:o=r,scheme:i="rdylbu",domain:a=Fl(n),unknown:l,interpolate:s,reverse:c}){return void 0===e&&(e=void 0!==s?Ct(s,o):Bi.get(t)===Ci?kl(i,o):void 0),a.length>0&&(a=ae(a,void 0===e?{length:o}:e).quantiles()),Cl(t,0,{domain:a,range:e,reverse:c,unknown:l})}(t,n,e);case"quantize":return function(t,n,{range:e,n:r=(void 0===e?5:(e=[...e]).length),scheme:o="rdylbu",domain:i=Rl(t,n),unknown:a,interpolate:l,reverse:s}){const[c,u]=le(i);let f;return void 0===e?(f=se(c,u,r),f[0]<=c&&f.splice(0,1),f[f.length-1]>=u&&f.pop(),r=f.length+1,e=void 0!==l?Ct(l,r):Bi.get(t)===Ci?kl(o,r):void 0):(f=Ct(ce(c,u),r+1).slice(1,-1),c instanceof Date&&(f=f.map((t=>new Date(t))))),Dr(Fo(i))<0&&f.reverse(),Cl(t,0,{domain:f,range:e,reverse:s,unknown:a})}(t,n,e);case"pow":return Nl(t,n,e);case"log":return function(t,n,{base:e=10,domain:r=Bl(n),...o}){return Sl(t,oe().base(e),n,{...o,domain:r})}(t,n,e);case"symlog":return function(t,n,{constant:e=1,...r}){return Sl(t,ie().constant(e),n,r)}(t,n,e);case"utc":return function(t,n,e){return Ul(t,Me(),n,e)}(t,n,e);case"time":return function(t,n,e){return Ul(t,$e(),n,e)}(t,n,e);case"point":return function(t,n,{align:e=.5,padding:r=.5,...o}){return Jl(Ee().align(e).padding(r),n,o,t)}(t,n,e);case"band":return function(t,n,{align:e=.5,padding:r=.1,paddingInner:o=r,paddingOuter:i=("fx"===t||"fy"===t?0:r),...a}){return Jl(ze().align(e).paddingInner(o).paddingOuter(i),n,a,t)}(t,n,e);case"identity":return function(t){return{type:"identity",scale:(n=Bi.get(t),n===Ni||n===Ti||n===Ri||n===Ii?he():t=>t)};var n}(t);case void 0:return;default:throw new Error(`unknown scale type: ${r}`)}}function hs(t){return"symbol"==typeof t?t.description:t}function ds(t){return"string"==typeof t?`${t}`.toLowerCase():t}const ps={toString:()=>"projection"};function ms(t){switch(t){case Ni:return"point";case Ci:return Xl;default:return"ordinal"}}function ys({type:t}){return"ordinal"===t||"point"===t||"band"===t||t===Xl}function gs({type:t}){return"threshold"===t}function vs(t){if(void 0===t)return!0;const n=t.domain(),e=t(n[0]);for(let r=1,o=n.length;rt,invert:t=>t};const c=t.unknown?t.unknown():void 0;return{type:n,domain:qo(e),...void 0!==r&&{range:qo(r)},...void 0!==a&&{transform:a},...l&&{percent:l},...void 0!==c&&{unknown:c},...void 0!==i&&{interval:i},...void 0!==o&&{interpolate:o},...t.clamp&&{clamp:t.clamp()},...void 0!==s&&{pivot:s,symmetric:!1},...t.base&&{base:t.base()},...t.exponent&&{exponent:t.exponent()},...t.constant&&{constant:t.constant()},...t.align&&{align:t.align(),round:t.round()},...t.padding&&(t.paddingInner?{paddingInner:t.paddingInner(),paddingOuter:t.paddingOuter()}:{padding:t.padding()}),...t.bandwidth&&{bandwidth:t.bandwidth(),step:t.step()},apply:n=>t(n),...t.invert&&{invert:n=>t.invert(n)}}}function $s(t){let n,e;return(...r)=>((e?.length!==r.length||e.some(((t,n)=>t!==r[n])))&&(e=r,n=t(...r)),n)}const Ms=$s((t=>new Intl.NumberFormat(t))),Ls=$s(((t,n)=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...n&&{month:n}}))),As=$s(((t,n)=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...n&&{weekday:n}})));function Es(t="en-US",n="short"){const e=Ls(t,n);return t=>null==t||isNaN(t=+new Date(Date.UTC(2e3,+t)))?void 0:e.format(t)}function zs(t="en-US",n="short"){const e=As(t,n);return t=>null==t||isNaN(t=+new Date(Date.UTC(2001,0,+t)))?void 0:e.format(t)}function Os(t){return Nr(t,"Invalid Date")}const Ss=function(t="en-US"){const n=function(t="en-US"){const n=Ms(t);return t=>null==t||isNaN(t)?void 0:n.format(t)}(t);return t=>(t instanceof Date?Os:"number"==typeof t?n:Mo)(t)}(),Ns=("undefined"!=typeof window?window.devicePixelRatio>1:"undefined"==typeof it)?0:.5;let Cs=0;function Ts(){return"plot-clip-"+ ++Cs}function Rs(t,{title:n,href:e,ariaLabel:r,ariaDescription:o,ariaHidden:i,target:a,fill:l,fillOpacity:s,stroke:c,strokeWidth:u,strokeOpacity:f,strokeLinejoin:h,strokeLinecap:d,strokeMiterlimit:p,strokeDasharray:m,strokeDashoffset:y,opacity:g,mixBlendMode:v,imageFilter:x,paintOrder:w,pointerEvents:b,shapeRendering:k,channels:$},{ariaLabel:M,fill:L="currentColor",fillOpacity:A,stroke:E="none",strokeOpacity:z,strokeWidth:O,strokeLinecap:S,strokeLinejoin:N,strokeMiterlimit:C,paintOrder:T}){null===L&&(l=null,s=null),null===E&&(c=null,f=null),Li(L)?Li(E)||Li(l)&&!$?.fill||(E="none"):!Li(E)||Li(c)&&!$?.stroke||(L="none");const[R,I]=Io(l,L),[W,j]=Wo(s,A),[B,F]=Io(c,E),[D,q]=Wo(f,z),[_,P]=Wo(g);Ai(F)||(void 0===u&&(u=O),void 0===d&&(d=S),void 0===h&&(h=N),void 0!==p||/^\s*round\s*$/i.test(h)||(p=C),Ai(I)||void 0!==w||(w=T));const[V,H]=Wo(u);return null!==L&&(t.fill=Ys(I,"currentColor"),t.fillOpacity=Us(j,1)),null!==E&&(t.stroke=Ys(F,"none"),t.strokeWidth=Us(H,1),t.strokeOpacity=Us(q,1),t.strokeLinejoin=Ys(h,"miter"),t.strokeLinecap=Ys(d,"butt"),t.strokeMiterlimit=Us(p,4),t.strokeDasharray=Ys(m,"none"),t.strokeDashoffset=Ys(y,"0")),t.target=Mo(a),t.ariaLabel=Mo(M),t.ariaDescription=Mo(o),t.ariaHidden=Mo(i),t.opacity=Us(P,1),t.mixBlendMode=Ys(v,"normal"),t.imageFilter=Ys(x,"none"),t.paintOrder=Ys(w,"normal"),t.pointerEvents=Ys(b,"auto"),t.shapeRendering=Ys(k,"auto"),{title:{value:n,optional:!0,filter:null},href:{value:e,optional:!0,filter:null},ariaLabel:{value:r,optional:!0,filter:null},fill:{value:R,scale:"auto",optional:!0},fillOpacity:{value:W,scale:"auto",optional:!0},stroke:{value:B,scale:"auto",optional:!0},strokeOpacity:{value:D,scale:"auto",optional:!0},strokeWidth:{value:V,optional:!0},opacity:{value:_,scale:"auto",optional:!0}}}function Is(t,n){n&&t.text((t=>Ss(n[t])))}function Ws(t,n){n&&t.text((([t])=>Ss(n[t])))}function js(t,{target:n,tip:e},{ariaLabel:r,title:o,fill:i,fillOpacity:a,stroke:l,strokeOpacity:s,strokeWidth:c,opacity:u,href:f}){r&&Vs(t,"aria-label",(t=>r[t])),i&&Vs(t,"fill",(t=>i[t])),a&&Vs(t,"fill-opacity",(t=>a[t])),l&&Vs(t,"stroke",(t=>l[t])),s&&Vs(t,"stroke-opacity",(t=>s[t])),c&&Vs(t,"stroke-width",(t=>c[t])),u&&Vs(t,"opacity",(t=>u[t])),f&&Ps(t,(t=>f[t]),n),e||function(t,n){n&&t.filter((t=>Wr(n[t]))).append("title").call(Is,n)}(t,o)}function Bs(t,{target:n,tip:e},{ariaLabel:r,title:o,fill:i,fillOpacity:a,stroke:l,strokeOpacity:s,strokeWidth:c,opacity:u,href:f}){r&&Vs(t,"aria-label",(([t])=>r[t])),i&&Vs(t,"fill",(([t])=>i[t])),a&&Vs(t,"fill-opacity",(([t])=>a[t])),l&&Vs(t,"stroke",(([t])=>l[t])),s&&Vs(t,"stroke-opacity",(([t])=>s[t])),c&&Vs(t,"stroke-width",(([t])=>c[t])),u&&Vs(t,"opacity",(([t])=>u[t])),f&&Ps(t,(([t])=>f[t]),n),e||function(t,n){n&&t.filter((([t])=>Wr(n[t]))).append("title").call(Ws,n)}(t,o)}function Fs(t,n,e){const r=J(t,(t=>n[t]));return void 0===e&&r.size>1+t.length>>1&&tl("Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null."),r.values()}function*Ds(t,n,e,r){const{z:o}=e,{z:i}=r,a=function({ariaLabel:t,title:n,fill:e,fillOpacity:r,stroke:o,strokeOpacity:i,strokeWidth:a,opacity:l,href:s},{tip:c}){return[t,c?void 0:n,e,r,o,i,a,l,s].filter((t=>void 0!==t))}(r,e),l=[...n,...a];for(const n of i?Fs(t,i,o):[t]){let t,e;t:for(const r of n){for(const t of l)if(!Tr(t[r])){e&&e.push(-1);continue t}if(void 0!==t){e.push(r);for(let n=0;nei(t[r]))),e=[r];continue t}}}else e&&(yield e),t=a.map((t=>ei(t[r]))),e=[r]}e&&(yield e)}}function qs(t,n,e,r){!function(t,n,e,r){let o;const{clip:i=r.clip}=n;switch(i){case"frame":{const{width:n,height:i,marginLeft:a,marginRight:l,marginTop:s,marginBottom:c}=e,u=Ts();o=`url(#${u})`,t=Ja("svg:g",r).call((t=>t.append("svg:clipPath").attr("id",u).append("rect").attr("x",a).attr("y",s).attr("width",n-l-a).attr("height",i-s-c))).each((function(){this.appendChild(t.node()),t.node=()=>this}));break}case"sphere":{const{projection:n}=r;if(!n)throw new Error('the "sphere" clip option requires a projection');const e=Ts();o=`url(#${e})`,t.append("clipPath").attr("id",e).append("path").attr("d",mt(n)({type:"Sphere"}));break}}Vs(t,"aria-label",n.ariaLabel),Vs(t,"aria-description",n.ariaDescription),Vs(t,"aria-hidden",n.ariaHidden),Vs(t,"clip-path",o)}(t,n,e,r),Vs(t,"fill",n.fill),Vs(t,"fill-opacity",n.fillOpacity),Vs(t,"stroke",n.stroke),Vs(t,"stroke-width",n.strokeWidth),Vs(t,"stroke-opacity",n.strokeOpacity),Vs(t,"stroke-linejoin",n.strokeLinejoin),Vs(t,"stroke-linecap",n.strokeLinecap),Vs(t,"stroke-miterlimit",n.strokeMiterlimit),Vs(t,"stroke-dasharray",n.strokeDasharray),Vs(t,"stroke-dashoffset",n.strokeDashoffset),Vs(t,"shape-rendering",n.shapeRendering),Vs(t,"filter",n.imageFilter),Vs(t,"paint-order",n.paintOrder);const{pointerEvents:o=(!1===r.pointerSticky?"none":void 0)}=n;Vs(t,"pointer-events",o)}function _s(t,n){!function(t,n,e){null!=e&&t.style(n,e)}(t,"mix-blend-mode",n.mixBlendMode),Vs(t,"opacity",n.opacity)}function Ps(t,n,e){t.each((function(t){const r=n(t);if(null!=r){const t=this.ownerDocument.createElementNS(Ne.svg,"a");t.setAttribute("fill","inherit"),t.setAttributeNS(Ne.xlink,"href",r),null!=e&&t.setAttribute("target",e),this.parentNode.insertBefore(t,this).appendChild(this)}}))}function Vs(t,n,e){null!=e&&t.attr(n,e)}function Hs(t,n,{x:e,y:r},o=Ns,i=Ns){o+=n.dx,i+=n.dy,e?.bandwidth&&(o+=e.bandwidth()/2),r?.bandwidth&&(i+=r.bandwidth()/2),(o||i)&&t.attr("transform",`translate(${o},${i})`)}function Ys(t,n){if((t=Mo(t))!==n)return t}function Us(t,n){if((t=Lo(t))!==n)return t}const Xs=/^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;function Gs(t){if(void 0===t)return"plot-d6a7b5";if(t=`${t}`,!Xs.test(t))throw new Error(`invalid class name: ${t}`);return t}function Zs(t,n){if("string"==typeof n)t.property("style",n);else if(null!=n)for(const e of t)Object.assign(e.style,n)}function Js({frameAnchor:t},{width:n,height:e,marginTop:r,marginRight:o,marginBottom:i,marginLeft:a}){return[/left$/.test(t)?a:/right$/.test(t)?n-o:(a+n-o)/2,/^top/.test(t)?r:/^bottom/.test(t)?e-i:(r+e-i)/2]}function Ks({x:t,y:n,fy:e,fx:r},{projection:o,aspectRatio:i},{width:a,marginTopDefault:l,marginRightDefault:s,marginBottomDefault:c,marginLeftDefault:u}){const f=e?e.scale.domain().length:1,h=function(t){if("function"==typeof t?.stream)return rl;if(Ho(t)&&(t=t.type),null!=t){if("function"!=typeof t){const{aspectRatio:n}=il(t);if(n)return n}return rl}}(o);if(h){const t=(1.1*f-.1)/(1.1*(r?r.scale.domain().length:1)-.1)*h,n=Math.max(.1,Math.min(10,t));return Math.round((a-u-s)*n+l+c)}const d=n?ys(n)?n.scale.domain().length:Math.max(7,17/f):1;if(null!=i){if(i=+i,!(isFinite(i)&&i>0))throw new Error(`invalid aspectRatio: ${i}`);const o=Qs("y",n)/(Qs("x",t)*i),f=r?r.scale.bandwidth():1,h=e?e.scale.bandwidth():1;return(o*(f*(a-u-s)-t.insetLeft-t.insetRight)+n.insetTop+n.insetBottom)/h+l+c}return!(!n&&!e)*Math.max(1,Math.min(60,d*f))*20+30*!!r+60}function Qs(t,n){if(!n)throw new Error(`aspectRatio requires ${t} scale`);const{type:e,domain:r}=n;let o;switch(e){case"linear":case"utc":case"time":o=Number;break;case"pow":{const t=n.scale.exponent();o=n=>Math.pow(n,t);break}case"log":o=Math.log;break;case"point":case"band":return r.length;default:throw new Error(`unsupported ${t} scale for aspectRatio: ${e}`)}const[i,a]=le(r);return Math.abs(o(a)-o(i))}function tc(t,{fx:n,fy:e}){const r=Ko(t),o=n?.value,i=e?.value;return n&&e?Q(r,(t=>(t.fx=o[t[0]],t.fy=i[t[0]],t)),(t=>o[t]),(t=>i[t])):n?Q(r,(t=>(t.fx=o[t[0]],t)),(t=>o[t])):Q(r,(t=>(t.fy=i[t[0]],t)),(t=>i[t]))}function nc(t){const n=[],e=new Uint32Array(tt(t,(t=>t.length)));for(const r of t){let o=0;for(const n of t)r!==n&&(e.set(n,o),o+=n.length);n.push(e.slice(0,o))}return n}const ec=new Map([["top",lc],["right",uc],["bottom",sc],["left",cc],["top-left",fc(lc,cc)],["top-right",fc(lc,uc)],["bottom-left",fc(sc,cc)],["bottom-right",fc(sc,uc)],["top-empty",function(t,{y:n},{x:e,y:r,empty:o}){if(o)return!1;if(!n)return;const i=ic(n,r);if(i>0)return ac(t,e,n[i-1])}],["right-empty",function(t,{x:n},{x:e,y:r,empty:o}){if(o)return!1;if(!n)return;const i=ic(n,e);if(i0)return ac(t,n[i-1],r)}],["empty",function(t,n,{empty:e}){return e}]]);const rc=new WeakMap;function oc(t){let n=rc.get(t);return n||rc.set(t,n=new Te(Do(t,((t,n)=>[t,n])))),n}function ic(t,n){return oc(t).get(n)}function ac(t,n,e){return function(t,n,e){return n=ei(n),e=ei(e),t.find((t=>Object.is(ei(t.x),n)&&Object.is(ei(t.y),e)))}(t,n,e)?.empty}function lc(t,{y:n},{y:e}){return!n||0===ic(n,e)}function sc(t,{y:n},{y:e}){return!n||ic(n,e)===n.length-1}function cc(t,{x:n},{x:e}){return!n||0===ic(n,e)}function uc(t,{x:n},{x:e}){return!n||ic(n,e)===n.length-1}function fc(t,n){return function(){return t.apply(null,arguments)&&n.apply(null,arguments)}}function hc(t,{channels:{fx:n,fy:e},groups:r}){return n&&e?t.map((({x:t,y:n})=>r.get(t)?.get(n)??[])):n?t.map((({x:t})=>r.get(t)??[])):t.map((({y:t})=>r.get(t)??[]))}class dc{constructor(t,n={},e={},r){const{facet:o="auto",facetAnchor:i,fx:a,fy:l,sort:s,dx:c=0,dy:u=0,margin:f=0,marginTop:h=f,marginRight:d=f,marginBottom:p=f,marginLeft:m=f,clip:y=r?.clip,channels:g,tip:v,render:x}=e;if(this.data=t,this.sort=Xo(s)?s:null,this.initializer=Yi(e).initializer,this.transform=this.initializer?e.transform:Hi(e).transform,null===o||!1===o?this.facet=null:(this.facet=Bo(!0===o?"include":o,"facet",["auto","include","exclude","super"]),this.fx=t===vo&&"string"==typeof a?[a]:a,this.fy=t===vo&&"string"==typeof l?[l]:l),this.facetAnchor=function(t){if(null==t)return null;const n=ec.get(`${t}`.toLowerCase());if(n)return n;throw new Error(`invalid facet anchor: ${t}`)}(i),n=Oi(n),void 0!==g&&(n={...yc(g),...n}),void 0!==r&&(n={...Rs(this,e,r),...n}),this.channels=Object.fromEntries(Object.entries(n).map((([n,e])=>{if(Uo(e.value)){const{value:t,label:n=e.label,scale:r=e.scale}=e.value;e={...e,label:n,scale:r,value:t}}if(t===vo&&"string"==typeof e.value){const{value:t}=e;e={...e,value:[t]}}return[n,e]})).filter((([t,{value:n,optional:e}])=>{if(null!=n)return!0;if(e)return!1;throw new Error(`missing channel value: ${t}`)}))),this.dx=+c,this.dy=+u,this.marginTop=+h,this.marginRight=+d,this.marginBottom=+p,this.marginLeft=+m,this.clip=Si(y),this.tip=function(t){return!0===t?"xy":!1===t||null==t?null:"string"==typeof t?Bo(t,"tip",["x","y","xy"]):t}(v),"super"===this.facet){if(a||l)throw new Error("super-faceting cannot use fx or fy");for(const t in this.channels){const{scale:e}=n[t];if("x"===e||"y"===e)throw new Error("super-faceting cannot use x or y")}}null!=x&&(this.render=mc(x,this.render))}initialize(t,n,e){let r=Fo(this.data);void 0===t&&null!=r&&(t=[Ko(r)]);const o=t;null!=this.transform&&(({facets:t,data:r}=this.transform(r,t,e)),r=Fo(r)),void 0!==t&&(t.original=o);const i=Fa(this.channels,r);return null!=this.sort&&function(t,n,e,r,o){const{order:i,reverse:a,reduce:l=!0,limit:s}=o;for(const c in o){if(!Bi.has(c))continue;let{value:u,order:f=i,reverse:h=a,reduce:d=l,limit:p=s}=di(o[c]);const m=u?.startsWith("-");if(m&&(u=u.slice(1)),f=void 0===f?m!==("width"===u||"height"===u)?Xa:Ua:Ya(f),null==d||!1===d)continue;const y="fx"===c||"fy"===c?Pa(n,r[c]):_a(e,c);if(!y)throw new Error(`missing channel for scale: ${c}`);const g=y.value,[v=0,x=1/0]=pi(p)?p:p<0?[p]:[0,p];if(null==u)y.domain=()=>{let t=Array.from(new nt(g));return h&&(t=t.reverse()),0===v&&x===1/0||(t=t.slice(v,x)),t};else{const n="data"===u?t:"height"===u?Va(e,"y1","y2"):"width"===u?Va(e,"x1","x2"):Ha(e,u,"y"===u?"y2":"x"===u?"x2":void 0),r=ma(!0===d?"max":d,n);y.domain=()=>{let t=ft(Ko(g),(t=>r.reduceIndex(t,n)),(t=>g[t]));return f&&t.sort(f),h&&t.reverse(),0===v&&x===1/0||(t=t.slice(v,x)),t.map(Ao)}}}}(r,t,i,n,this.sort),{data:r,facets:t,channels:i}}filter(t,n,e){for(const r in n){const{filter:o=Tr}=n[r];if(null!==o){const n=e[r];t=t.filter((t=>o(n[t])))}}return t}project(t,n,e){for(const r in t)if("x"===t[r].scale&&/^x|x$/.test(r)){const o=r.replace(/^x|x$/,"y");o in t&&"y"===t[o].scale&&ul(r,o,n,e.projection)}}scale(t,n,e){const r=Da(t,n);return e.projection&&this.project(t,r,e),r}}function pc(...t){return t.plot=dc.prototype.plot,t}function mc(t,n){if(null==t)return null===n?void 0:n;if(null==n)return null===t?void 0:t;if("function"!=typeof t)throw new TypeError(`invalid render transform: ${t}`);if("function"!=typeof n)throw new TypeError(`invalid render transform: ${n}`);return function(e,r,o,i,a,l){return t.call(this,e,r,o,i,a,((t,e,r,o,i)=>n.call(this,t,e,r,o,i,l)))}}function yc(t){return Object.fromEntries(Object.entries(Oi(t)).map((([t,n])=>(void 0===(n="string"==typeof n?{value:n,label:t}:di(n)).filter&&null==n.scale&&(n={...n,filter:null}),[t,n]))))}function gc(t,n){return!0===t?.tip?{...t,tip:n}:Ho(t?.tip)&&void 0===t.tip.pointer?{...t,tip:{...t.tip,pointer:n}}:t}const vc=new WeakMap;function xc(t,n,{x:e,y:r,px:o,py:i,maxRadius:a=40,channels:l,render:s,...c}={}){return a=+a,null!=o&&(e??=null,l={...l,px:{value:o,scale:"x"}}),null!=i&&(r??=null,l={...l,py:{value:i,scale:"y"}}),{x:e,y:r,channels:l,...c,render:mc((function(e,r,o,i,l,s){const c=(l={...l,pointerSticky:!1}).ownerSVGElement,{data:u}=l.getMarkState(this);let f=vc.get(c);f||vc.set(c,f={sticky:!1,roots:[],renders:[]});let h=f.renders.push(C)-1;const{x:d,y:p,fx:m,fy:y}=r;let g=m?m(e.fx)-i.marginLeft:0,v=y?y(e.fy)-i.marginTop:0;d?.bandwidth&&(g+=d.bandwidth()/2),p?.bandwidth&&(v+=p.bandwidth()/2);const x=null!=e.fi;let w;if(x){let t=f.facetStates;t||(f.facetStates=t=new Map),w=t.get(this),w||t.set(this,w=new Map)}const[b,k]=Js(this,i),{px:$,py:M}=o,L=$?t=>$[t]:$c(o,b),A=M?t=>M[t]:Mc(o,k);let E,z,O,S;function N(t,n){if(x){if(S&&(S=cancelAnimationFrame(S)),null!=t)return w.set(e.fi,n),void(S=requestAnimationFrame((()=>{S=null;for(const[r,o]of w)if(o1||l.dispatchValue(null==E?null:u[E]),a}function T(r){if(f.sticky||"mouse"===r.pointerType&&1===r.buttons)return;let[o,l]=Re(r);o-=g,l-=v;const s=oi.width-i.marginRight?1:t,c=li.height-i.marginBottom?1:n;let u=null,h=a*a;for(const t of e){const n=s*(L(t)-o),e=c*(A(t)-l),r=n*n+e*e;r<=h&&(u=t,h=r)}if(null!=u&&(1!==t||1!==n)){const t=L(u)-o,n=A(u)-l;h=t*t+n*n}N(u,h)}return c.addEventListener("pointerenter",T),c.addEventListener("pointermove",T),c.addEventListener("pointerdown",(function(t){"mouse"===t.pointerType&&null!=E&&(f.sticky&&f.roots.some((n=>n?.contains(t.target)))||(f.sticky?(f.sticky=!1,f.renders.forEach((t=>t(null)))):(f.sticky=!0,C(E)),t.stopImmediatePropagation()))})),c.addEventListener("pointerleave",(function(t){"mouse"===t.pointerType&&(f.sticky||N(null))})),C(null)}),s)}}function wc(t){return xc(1,1,t)}function bc(t){return xc(1,.01,t)}function kc(t){return xc(.01,1,t)}function $c({x1:t,x2:n,x:e=t},r){return t&&n?e=>(t[e]+n[e])/2:e?t=>e[t]:()=>r}function Mc({y1:t,y2:n,y:e=t},r){return t&&n?e=>(t[e]+n[e])/2:e?t=>e[t]:()=>r}function Lc(t){return ys(t)&&void 0===t.interval?void 0:"tabular-nums"}const Ac=Math.PI/180;function Ec(t,{marker:n,markerStart:e=n,markerMid:r=n,markerEnd:o=n}={}){t.markerStart=zc(e),t.markerMid=zc(r),t.markerEnd=zc(o)}function zc(t){if(null==t||!1===t)return null;if(!0===t)return Nc;if("function"==typeof t)return t;switch(`${t}`.toLowerCase()){case"none":return null;case"arrow":return Oc("auto");case"arrow-reverse":return Oc("auto-start-reverse");case"dot":return Sc;case"circle":case"circle-fill":return Nc;case"circle-stroke":return Cc;case"tick":return Tc("auto");case"tick-x":return Tc(90);case"tick-y":return Tc(0)}throw new Error(`invalid marker: ${t}`)}function Oc(t){return(n,e)=>Ja("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("orient",t).attr("fill","none").attr("stroke",n).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").call((t=>t.append("path").attr("d","M-1.5,-3l3,3l-3,3"))).node()}function Sc(t,n){return Ja("svg:marker",n).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",t).attr("stroke","none").call((t=>t.append("circle").attr("r",2.5))).node()}function Nc(t,n){return Ja("svg:marker",n).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",t).attr("stroke","var(--plot-background)").attr("stroke-width",1.5).call((t=>t.append("circle").attr("r",3))).node()}function Cc(t,n){return Ja("svg:marker",n).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill","var(--plot-background)").attr("stroke",t).attr("stroke-width",1.5).call((t=>t.append("circle").attr("r",3))).node()}function Tc(t){return(n,e)=>Ja("svg:marker",e).attr("viewBox","-3 -3 6 6").attr("markerWidth",6).attr("markerHeight",6).attr("orient",t).attr("stroke",n).call((t=>t.append("path").attr("d","M0,-3v6"))).node()}let Rc=0;function Ic(t,n,{stroke:e},r){return jc(t,n,e&&(t=>e[t]),r)}function Wc(t,n,{stroke:e},r){return jc(t,n,e&&(([t])=>e[t]),r)}function jc(t,{markerStart:n,markerMid:e,markerEnd:r,stroke:o},i=(()=>o),a){const l=new Map;function s(t){return function(n){const e=i(n);let r=l.get(t);r||l.set(t,r=new Map);let o=r.get(e);if(!o){const n=this.parentNode.insertBefore(t(e,a),this),i="plot-marker-"+ ++Rc;n.setAttribute("id",i),r.set(e,o=`url(#${i})`)}return o}}n&&t.attr("marker-start",s(n)),e&&t.attr("marker-mid",s(e)),r&&t.attr("marker-end",s(r))}function Bc({inset:t,insetLeft:n,insetRight:e,...r}={}){return[n,e]=Dc(t,n,e),{inset:t,insetLeft:n,insetRight:e,...r}}function Fc({inset:t,insetTop:n,insetBottom:e,...r}={}){return[n,e]=Dc(t,n,e),{inset:t,insetTop:n,insetBottom:e,...r}}function Dc(t,n,e){return void 0===t&&void 0===n&&void 0===e?Ns?[1,0]:[.5,.5]:[n,e]}function qc(t,{interval:n}){return(t={...di(t)}).interval=ui(void 0===t.interval?n:t.interval),t}function _c(t,n,e,r){const{[t]:o,[`${t}1`]:i,[`${t}2`]:a}=e,{value:l,interval:s}=qc(o,e);if(null==l||null==s&&!r)return e;const c=ai(o);if(null==s){let n;const o={transform:t=>n||(n=mo(t,l)),label:c};return{...e,[t]:void 0,[`${t}1`]:void 0===i?o:i,[`${t}2`]:void 0!==a||i===a&&r?a:o}}let u,f;function h(t){return void 0!==f&&t===u?f:f=Do(mo(u=t,l),(t=>s.floor(t)))}return n({...e,[t]:void 0,[`${t}1`]:void 0===i?{transform:h,label:c}:i,[`${t}2`]:void 0===a?{transform:t=>h(t).map((t=>s.offset(t))),label:c}:a})}function Pc(t,n,e){const{[t]:r}=e,{value:o,interval:i}=qc(r,e);return null==o||null==i?e:n({...e,[t]:{label:ai(r),transform:t=>{const n=Do(mo(t,o),(t=>i.floor(t))),e=n.map((t=>i.offset(t)));return n.map(gi(n)?(t,n)=>null==t||isNaN(t=+t)||null==(n=e[n])||isNaN(n=+n)?void 0:new Date((t+n)/2):(t,n)=>null==t||null==(n=e[n])?NaN:(+t+ +n)/2)}}})}function Vc(t={}){return _c("x",Bc,t,!0)}function Hc(t={}){return _c("y",Fc,t,!0)}function Yc(t={}){return _c("x",Bc,t)}function Uc(t={}){return _c("y",Fc,t)}function Xc(t={}){return Pc("x",Bc,t)}function Gc(t={}){return Pc("y",Fc,t)}const Zc={ariaLabel:"rule",fill:null,stroke:"currentColor"};class Jc extends dc{constructor(t,n={}){const{x:e,y1:r,y2:o,inset:i=0,insetTop:a=i,insetBottom:l=i}=n;super(t,{x:{value:e,scale:"x",optional:!0},y1:{value:r,scale:"y",optional:!0},y2:{value:o,scale:"y",optional:!0}},gc(n,"x"),Zc),this.insetTop=Lo(a),this.insetBottom=Lo(l),Ec(this,n)}render(t,n,e,r,o){const{x:i,y:a}=n,{x:l,y1:s,y2:c}=e,{width:u,height:f,marginTop:h,marginRight:d,marginLeft:p,marginBottom:m}=r,{insetTop:y,insetBottom:g}=this;return Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,{x:l&&i},Ns,0).call((n=>n.selectAll().data(t).enter().append("line").call(_s,this).attr("x1",l?t=>l[t]:(p+u-d)/2).attr("x2",l?t=>l[t]:(p+u-d)/2).attr("y1",s&&!vs(a)?t=>s[t]+y:h+y).attr("y2",c&&!vs(a)?a.bandwidth?t=>c[t]+a.bandwidth()-g:t=>c[t]-g:f-m-g).call(js,this,e).call(Ic,this,e,o))).node()}}class Kc extends dc{constructor(t,n={}){const{x1:e,x2:r,y:o,inset:i=0,insetRight:a=i,insetLeft:l=i}=n;super(t,{y:{value:o,scale:"y",optional:!0},x1:{value:e,scale:"x",optional:!0},x2:{value:r,scale:"x",optional:!0}},gc(n,"y"),Zc),this.insetRight=Lo(a),this.insetLeft=Lo(l),Ec(this,n)}render(t,n,e,r,o){const{x:i,y:a}=n,{y:l,x1:s,x2:c}=e,{width:u,height:f,marginTop:h,marginRight:d,marginLeft:p,marginBottom:m}=r,{insetLeft:y,insetRight:g}=this;return Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,{y:l&&a},0,Ns).call((n=>n.selectAll().data(t).enter().append("line").call(_s,this).attr("x1",s&&!vs(i)?t=>s[t]+y:p+y).attr("x2",c&&!vs(i)?i.bandwidth?t=>c[t]+i.bandwidth()-g:t=>c[t]-g:u-d-g).attr("y1",l?t=>l[t]:(h+f-m)/2).attr("y2",l?t=>l[t]:(h+f-m)/2).call(js,this,e).call(Ic,this,e,o))).node()}}function Qc(t,n){let{x:e=bo,y:r,y1:o,y2:i,...a}=Uc(n);return[o,i]=nu(r,o,i),new Jc(t,{...a,x:e,y1:o,y2:i})}function tu(t,n){let{y:e=bo,x:r,x1:o,x2:i,...a}=Yc(n);return[o,i]=nu(r,o,i),new Kc(t,{...a,y:e,x1:o,x2:i})}function nu(t,n,e){if(null==t){if(void 0===n){if(void 0!==e)return[0,e]}else if(void 0===e)return[0,n]}else{if(void 0===n)return void 0===e?[0,t]:[t,e];if(void 0===e)return[t,n]}return[n,e]}function eu(t,...n){let e=n.length;for(let r=0,o=!0;r{let o=t[0];for(let i=0;imo(t,k,Float64Array),label:ai(k)}),optional:!0},text:{value:o,filter:Wr,optional:!0}},n,ru),this.rotate=x,this.textAnchor=Ys(a,"middle"),this.lineAnchor=Bo(l,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+s,this.lineWidth=+c,this.textOverflow=au(u),this.monospace=!!f,this.fontFamily=Mo(h),this.fontSize=b,this.fontStyle=Mo(p),this.fontVariant=Mo(m),this.fontWeight=Mo(y),this.frameAnchor=zi(i),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${c}`);this.splitLines=gu(this),this.clipLine=vu(this)}render(t,n,e,r,o){const{x:i,y:a}=n,{x:l,y:s,rotate:c,text:u,title:f,fontSize:h}=e,{rotate:d}=this,[p,m]=Js(this,r);return Ja("svg:g",o).call(qs,this,r,o).call(fu,this,u,r).call(Hs,this,{x:l&&i,y:s&&a}).call((n=>n.selectAll().data(t).enter().append("text").call(_s,this).call(lu,this,u,f).attr("transform",eu`translate(${l?t=>l[t]:p},${s?t=>s[t]:m})${c?t=>` rotate(${c[t]})`:d?` rotate(${d})`:""}`).call(Vs,"font-size",h&&(t=>h[t])).call(js,this,e))).node()}}function au(t){return null==t?null:Bo(t,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}function lu(t,n,e,r){if(!e)return;const{lineAnchor:o,lineHeight:i,textOverflow:a,splitLines:l,clipLine:s}=n;t.each((function(t){const n=l(Ss(e[t])??"").map(s),c=n.length,u="top"===o?.71:"bottom"===o?1-c:(164-100*c)/200;if(c>1){let t=0;for(let e=0;eo&&e(t,o,l)>n&&(r.push(t.slice(o,i)+(t[i-1]===ou?"-":"")),o=a),s?(r.push(t.slice(o,l)),o=void 0):i=l;return r}const pu={a:56,b:63,c:57,d:63,e:58,f:37,g:62,h:60,i:26,j:26,k:55,l:26,m:88,n:60,o:60,p:62,q:62,r:39,s:54,t:38,u:60,v:55,w:79,x:54,y:55,z:55,A:69,B:67,C:73,D:74,E:61,F:58,G:76,H:75,I:28,J:55,K:67,L:58,M:89,N:75,O:78,P:65,Q:78,R:67,S:65,T:65,U:75,V:69,W:98,X:69,Y:67,Z:67,0:64,1:48,2:62,3:64,4:66,5:63,6:65,7:58,8:65,9:65," ":29,"!":32,'"':49,"'":31,"(":39,")":39,",":31,"-":48,".":31,"/":32,":":31,";":31,"?":52,"‘":31,"’":31,"“":47,"”":47,"…":82};function mu(t,n=0,e=t.length){let r=0;for(let o=n;ot.split(/\r\n?|\n/g);const r=t?yu:mu,o=100*n;return t=>du(t,o,r)}function vu({monospace:t,lineWidth:n,textOverflow:e}){if(null==e||n==1/0)return t=>t;const r=t?yu:mu,o=100*n;switch(e){case"clip-start":return t=>ku(t,o,r,"");case"clip-end":return t=>bu(t,o,r,"");case"ellipsis-start":return t=>ku(t,o,r,xu);case"ellipsis-middle":return t=>function(t,n,e,r){t=t.trim();const o=e(t);if(o<=n)return t;const i=e(r)/2,[a,l]=wu(t,n/2,e,i),[s]=wu(t,o-n/2-l+i,e,-i);return s<0?r:t.slice(0,a).trimEnd()+r+t.slice(Lu(t,s)).trimStart()}(t,o,r,xu);case"ellipsis-end":return t=>bu(t,o,r,xu)}}const xu="…";function wu(t,n,e,r){const o=[];let i=0;for(let a=0,l=0,s=t.length;an){for(i+=r;i>n&&a>0;)l=a,a=o.pop(),i-=e(t,a,l);return[a,n-i]}i+=s,o.push(a)}return[-1,0]}function bu(t,n,e,r){t=t.trim();const o=e(r),[i]=wu(t,n,e,o);return i<0?t:t.slice(0,i).trimEnd()+r}function ku(t,n,e,r){const o=e(t=t.trim());if(o<=n)return t;const i=e(r),[a]=wu(t,o-n+i,e,-i);return a<0?r:r+t.slice(Lu(t,a)).trimStart()}const $u=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,Mu=/\p{Extended_Pictographic}/uy;function Lu(t,n){return n+=function(t,n){const e=t.charCodeAt(n);if(e>=55296&&e<56320){const e=t.charCodeAt(n+1);return e>=56320&&e<57344}return!1}(t,n)?2:1,function(t,n){return!Au(t,n)&&($u.lastIndex=n,$u.test(t))}(t,n)&&(n=$u.lastIndex),function(t,n){return 8205===t.charCodeAt(n)}(t,n)?Lu(t,n+1):n}function Au(t,n){return t.charCodeAt(n)<128}function Eu(t,n){return!Au(t,n)&&(Mu.lastIndex=n,Mu.test(t))}const zu={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},Ou=3.5,Su=5*Ou,Nu={draw(t,n,e){const r=n*e/Su;t.moveTo(0,0),t.lineTo(0,-n),t.moveTo(-r,r-n),t.lineTo(0,-n),t.lineTo(r,r-n)}},Cu={draw(t,n,e){t.moveTo(-e,0),t.lineTo(0,-n),t.lineTo(e,0)}},Tu=new Map([["arrow",Nu],["spike",Cu]]);class Ru extends dc{constructor(t,n={}){const{x:e,y:r,r:o=Ou,length:i,rotate:a,shape:l=Nu,anchor:s="middle",frameAnchor:c}=n,[u,f]=Wo(i,12),[h,d]=Wo(a,0);super(t,{x:{value:e,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},length:{value:u,scale:"length",optional:!0},rotate:{value:h,optional:!0}},n,zu),this.r=+o,this.length=f,this.rotate=d,this.shape=function(t){if(function(t){return t&&"function"==typeof t.draw}(t))return t;const n=Tu.get(`${t}`.toLowerCase());if(n)return n;throw new Error(`invalid shape: ${t}`)}(l),this.anchor=Bo(s,"anchor",["start","middle","end"]),this.frameAnchor=zi(c)}render(t,n,e,r,o){const{x:i,y:a}=n,{x:l,y:s,length:c,rotate:u}=e,{length:f,rotate:h,anchor:d,shape:p,r:m}=this,[y,g]=Js(this,r);return Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,{x:l&&i,y:s&&a}).call((n=>n.selectAll().data(t).enter().append("path").call(_s,this).attr("transform",eu`translate(${l?t=>l[t]:y},${s?t=>s[t]:g})${u?t=>` rotate(${u[t]})`:h?` rotate(${h})`:""}${"start"===d?"":"end"===d?c?t=>` translate(0,${c[t]})`:` translate(0,${f})`:c?t=>` translate(0,${c[t]/2})`:` translate(0,${f/2})`}`).attr("d",c?t=>{const n=je();return p.draw(n,c[t],m),n}:(()=>{const t=je();return p.draw(t,f,m),t})()).call(js,this,e))).node()}}function Iu(t,n={}){let{x:e,y:r,...o}=n;return void 0===n.frameAnchor&&([e,r]=Zo(e,r)),new Ru(t,{...o,x:e,y:r})}function Wu(t,n={}){const{x:e=bo,...r}=n;return new Ru(t,{...r,x:e})}function ju(t,n={}){const{y:e=bo,...r}=n;return new Ru(t,{...r,y:e})}function Bu(t,n={}){const{shape:e=Cu,stroke:r=zu.stroke,strokeWidth:o=1,fill:i=r,fillOpacity:a=.3,anchor:l="start",...s}=n;return Iu(t,{...s,shape:e,stroke:r,strokeWidth:o,fill:i,fillOpacity:a,anchor:l})}function Fu(t,n){return arguments.length<2&&!pi(t)&&(n=t,t=null),void 0===n&&(n={}),[t,n]}function Du({anchor:t}={},n){return void 0===t?n[0]:Bo(t,"anchor",n)}function qu(t){return Du(t,["left","right"])}function _u(t){return Du(t,["right","left"])}function Pu(t){return Du(t,["bottom","top"])}function Vu(t){return Du(t,["top","bottom"])}function Hu(){const[t,n]=Fu(...arguments);return Gu("y",qu(n),t,n)}function Yu(){const[t,n]=Fu(...arguments);return Gu("fy",_u(n),t,n)}function Uu(){const[t,n]=Fu(...arguments);return Zu("x",Pu(n),t,n)}function Xu(){const[t,n]=Fu(...arguments);return Zu("fx",Vu(n),t,n)}function Gu(t,n,e,{color:r="currentColor",opacity:o=1,stroke:i=r,strokeOpacity:a=o,strokeWidth:l=1,fill:s=r,fillOpacity:c=o,textAnchor:u,textStroke:f,textStrokeOpacity:h,textStrokeWidth:d,tickSize:p=("y"===t?6:0),tickPadding:m,tickRotate:y,x:g,margin:v,marginTop:x=(void 0===v?20:v),marginRight:w=(void 0===v?"right"===n?40:0:v),marginBottom:b=(void 0===v?20:v),marginLeft:k=(void 0===v?"left"===n?40:0:v),label:$,labelAnchor:M,labelArrow:L,labelOffset:A,...E}){return p=Lo(p),m=Lo(m),y=Lo(y),void 0!==M&&(M=Bo(M,"labelAnchor",["center","top","bottom"])),L=yf(L),pc(p&&!Li(i)?function(t,n,e,{strokeWidth:r=1,strokeLinecap:o=null,strokeLinejoin:i=null,facetAnchor:a=n+("y"===t?"-empty":""),frameAnchor:l=n,tickSize:s,inset:c=0,insetLeft:u=c,insetRight:f=c,dx:h=0,y:d=("y"===t?void 0:null),...p}){return af(ju,t,e,{ariaLabel:`${t}-axis tick`,ariaHidden:!0},{strokeWidth:r,strokeLinecap:o,strokeLinejoin:i,facetAnchor:a,frameAnchor:l,y:d,...p,dx:"left"===n?+h-Ns+ +u:+h+Ns-f,anchor:"start",length:s,shape:"left"===n?hf:df})}(t,n,e,{stroke:i,strokeOpacity:a,strokeWidth:l,tickSize:p,tickPadding:m,tickRotate:y,x:g,...E}):null,Li(s)?null:function(t,n,e,{facetAnchor:r=n+("y"===t?"-empty":""),frameAnchor:o=n,tickSize:i,tickRotate:a=0,tickPadding:l=Math.max(3,9-i)+(Math.abs(a)>60?4*Math.cos(a*Ac):0),text:s,textAnchor:c=(Math.abs(a)>60?"middle":"left"===n?"end":"start"),lineAnchor:u=(a>60?"top":a<-60?"bottom":"middle"),fontVariant:f,inset:h=0,insetLeft:d=h,insetRight:p=h,dx:m=0,y:y=("y"===t?void 0:null),...g}){return af(uu,t,e,{ariaLabel:`${t}-axis tick label`},{facetAnchor:r,frameAnchor:o,text:s,textAnchor:c,lineAnchor:u,fontVariant:f,rotate:a,y:y,...g,dx:"left"===n?+m-i-l+ +d:+m+ +i+ +l-p},(function(t,e,r,o,i){void 0===f&&(this.fontVariant=pf(t)),void 0===s&&(i.text=lf(t,e,r,o,n))}))}(t,n,e,{fill:s,fillOpacity:c,stroke:f,strokeOpacity:h,strokeWidth:d,textAnchor:u,tickSize:p,tickPadding:m,tickRotate:y,x:g,marginTop:x,marginRight:w,marginBottom:b,marginLeft:k,...E}),Li(s)||null===$?null:su([],of({fill:s,fillOpacity:c,...E},(function(e,r,o,i,a){const l=i[t],{marginTop:s,marginRight:c,marginBottom:u,marginLeft:f}="y"===t&&a.inset||a,h=M??(l.bandwidth?"center":"top"),d=A??("right"===n?c:f)-3;return"center"===h?(this.textAnchor=void 0,this.lineAnchor="right"===n?"bottom":"top",this.frameAnchor=n,this.rotate=-90):(this.textAnchor="right"===n?"end":"start",this.lineAnchor=h,this.frameAnchor=`${h}-${n}`,this.rotate=0),this.dy="top"===h?3-s:"bottom"===h?u-3:0,this.dx="right"===n?d:-d,this.ariaLabel=`${t}-axis label`,{facets:[[0]],channels:{text:{value:[mf(t,l,{anchor:n,label:$,labelAnchor:h,labelArrow:L})]}}}}))))}function Zu(t,n,e,{color:r="currentColor",opacity:o=1,stroke:i=r,strokeOpacity:a=o,strokeWidth:l=1,fill:s=r,fillOpacity:c=o,textAnchor:u,textStroke:f,textStrokeOpacity:h,textStrokeWidth:d,tickSize:p=("x"===t?6:0),tickPadding:m,tickRotate:y,y:g,margin:v,marginTop:x=(void 0===v?"top"===n?30:0:v),marginRight:w=(void 0===v?20:v),marginBottom:b=(void 0===v?"bottom"===n?30:0:v),marginLeft:k=(void 0===v?20:v),label:$,labelAnchor:M,labelArrow:L,labelOffset:A,...E}){return p=Lo(p),m=Lo(m),y=Lo(y),void 0!==M&&(M=Bo(M,"labelAnchor",["center","left","right"])),L=yf(L),pc(p&&!Li(i)?function(t,n,e,{strokeWidth:r=1,strokeLinecap:o=null,strokeLinejoin:i=null,facetAnchor:a=n+("x"===t?"-empty":""),frameAnchor:l=n,tickSize:s,inset:c=0,insetTop:u=c,insetBottom:f=c,dy:h=0,x:d=("x"===t?void 0:null),...p}){return af(Wu,t,e,{ariaLabel:`${t}-axis tick`,ariaHidden:!0},{strokeWidth:r,strokeLinejoin:i,strokeLinecap:o,facetAnchor:a,frameAnchor:l,x:d,...p,dy:"bottom"===n?+h-Ns-f:+h+Ns+ +u,anchor:"start",length:s,shape:"bottom"===n?uf:ff})}(t,n,e,{stroke:i,strokeOpacity:a,strokeWidth:l,tickSize:p,tickPadding:m,tickRotate:y,y:g,...E}):null,Li(s)?null:function(t,n,e,{facetAnchor:r=n+("x"===t?"-empty":""),frameAnchor:o=n,tickSize:i,tickRotate:a=0,tickPadding:l=Math.max(3,9-i)+(Math.abs(a)>=10?4*Math.cos(a*Ac):0),text:s,textAnchor:c=(Math.abs(a)>=10?a<0^"bottom"===n?"start":"end":"middle"),lineAnchor:u=(Math.abs(a)>=10?"middle":"bottom"===n?"top":"bottom"),fontVariant:f,inset:h=0,insetTop:d=h,insetBottom:p=h,dy:m=0,x:y=("x"===t?void 0:null),...g}){return af(cu,t,e,{ariaLabel:`${t}-axis tick label`},{facetAnchor:r,frameAnchor:o,text:void 0===s?null:s,textAnchor:c,lineAnchor:u,fontVariant:f,rotate:a,x:y,...g,dy:"bottom"===n?+m+ +i+ +l-p:+m-i-l+ +d},(function(t,e,r,o,i){void 0===f&&(this.fontVariant=pf(t)),void 0===s&&(i.text=lf(t,e,r,o,n))}))}(t,n,e,{fill:s,fillOpacity:c,stroke:f,strokeOpacity:h,strokeWidth:d,textAnchor:u,tickSize:p,tickPadding:m,tickRotate:y,y:g,marginTop:x,marginRight:w,marginBottom:b,marginLeft:k,...E}),Li(s)||null===$?null:su([],of({fill:s,fillOpacity:c,...E},(function(e,r,o,i,a){const l=i[t],{marginTop:s,marginRight:c,marginBottom:u,marginLeft:f}="x"===t&&a.inset||a,h=M??(l.bandwidth?"center":"right"),d=A??("top"===n?s:u)-3;return"center"===h?(this.frameAnchor=n,this.textAnchor=void 0):(this.frameAnchor=`${n}-${h}`,this.textAnchor="right"===h?"end":"start"),this.lineAnchor=n,this.dy="top"===n?-d:d,this.dx="right"===h?c-3:"left"===h?3-f:0,this.ariaLabel=`${t}-axis label`,{facets:[[0]],channels:{text:{value:[mf(t,l,{anchor:n,label:$,labelAnchor:h,labelArrow:L})]}}}}))))}function Ju(){const[t,n]=Fu(...arguments);return nf("y",qu(n),t,n)}function Ku(){const[t,n]=Fu(...arguments);return nf("fy",_u(n),t,n)}function Qu(){const[t,n]=Fu(...arguments);return ef("x",Pu(n),t,n)}function tf(){const[t,n]=Fu(...arguments);return ef("fx",Vu(n),t,n)}function nf(t,n,e,{y:r=("y"===t?void 0:null),x:o=null,x1:i=("left"===n?o:null),x2:a=("right"===n?o:null),...l}){return af(tu,t,e,{ariaLabel:`${t}-grid`,ariaHidden:!0},{y:r,x1:i,x2:a,...rf(l)})}function ef(t,n,e,{x:r=("x"===t?void 0:null),y:o=null,y1:i=("top"===n?o:null),y2:a=("bottom"===n?o:null),...l}){return af(Qc,t,e,{ariaLabel:`${t}-grid`,ariaHidden:!0},{x:r,y1:i,y2:a,...rf(l)})}function rf({color:t="currentColor",opacity:n=.1,stroke:e=t,strokeOpacity:r=n,strokeWidth:o=1,...i}){return{stroke:e,strokeOpacity:r,strokeWidth:o,...i}}function of({fill:t,fillOpacity:n,fontFamily:e,fontSize:r,fontStyle:o,fontVariant:i,fontWeight:a,monospace:l,pointerEvents:s,shapeRendering:c,clip:u=!1},f){return[,t]=Io(t),[,n]=Wo(n),{facet:"super",x:null,y:null,fill:t,fillOpacity:n,fontFamily:e,fontSize:r,fontStyle:o,fontVariant:i,fontWeight:a,monospace:l,pointerEvents:s,shapeRendering:c,clip:u,initializer:f}}function af(t,n,e,r,o,i){let a;const l=Yi(o).initializer,s=t(e,Yi({...o,initializer:function(t,e,r,l,s,c){const u=null==t&&("fx"===n||"fy"===n),{[n]:f}=l;if(!f)throw new Error(`missing scale: ${n}`);const h=f.domain();let{interval:d,ticks:p,tickFormat:m,tickSpacing:y=("x"===n?80:35)}=o;if("string"==typeof p&&gf(f)&&(d=p,p=void 0),void 0===p&&(p=fi(d,f.type)??function(t,n){const[e,r]=le(t.range());return(r-e)/n}(f,y)),null==t){if(pi(p))t=Fo(p);else if(hi(p))t=cf(p,...le(h));else if(f.interval){let n=f.interval;if(f.ticks){const[e,r]=le(h);n=lo(n,(r-e)/n[Kr]/p)??n,t=cf(n,e,r)}else{n=lo(n,(t=h).length/p)??n,n!==f.interval&&(t=cf(n,...le(t)))}if(n===f.interval){const n=Math.round(t.length/p);n>1&&(t=t.filter(((t,e)=>e%n==0)))}}else t=f.ticks?f.ticks(p):h;if(!f.ticks&&t.length&&t!==h){const e=new nt(h);(t=t.filter((t=>e.has(t)))).length||tl(`Warning: the ${n}-axis ticks appear to not align with the scale domain, resulting in no ticks. Try different ticks?`)}"y"===n||"x"===n?e=[Ko(t)]:a[n]={scale:n,value:bo}}i?.call(this,f,t,p,m,a);const g=Object.fromEntries(Object.entries(a).map((([n,e])=>[n,{...e,value:mo(t,e.value)}])));return u&&(e=c.filterFacets(t,g)),{data:t,facets:e,channels:g}}},l));return null==e?(a=s.channels,s.channels={}):a={},void 0!==r&&Object.assign(s,r),void 0===s.clip&&(s.clip=!1),s}function lf(t,n,e,r,o){return{value:sf(t,n,e,r,o)}}function sf(t,n,e,r,o){return"function"==typeof r?r:void 0===r&&n&&gi(n)?co(t.type,n,o)??Ss:t.tickFormat?t.tickFormat("number"==typeof e?e:null,r):void 0===r?Ss:"string"==typeof r?(gi(t.domain())?R:Ie)(r):Oo(r)}function cf(t,n,e){return t.range(n,t.offset(t.floor(e)))}const uf={draw(t,n){t.moveTo(0,0),t.lineTo(0,n)}},ff={draw(t,n){t.moveTo(0,0),t.lineTo(0,-n)}},hf={draw(t,n){t.moveTo(0,0),t.lineTo(-n,0)}},df={draw(t,n){t.moveTo(0,0),t.lineTo(n,0)}};function pf(t){return t.bandwidth&&!t.interval?void 0:"tabular-nums"}function mf(t,n,{anchor:e,label:r=n.label,labelAnchor:o,labelArrow:i}={}){if(!(null==r||r.inferred&&gf(n)&&/^(date|time|year)$/i.test(r))){if(r=String(r),"auto"===i&&(i=(!n.bandwidth||n.interval)&&!/[↑↓→←]/.test(r)),!i)return r;if(!0===i){const e=rs(n);e&&(i=/x$/.test(t)||"center"===o?/x$/.test(t)===e<0?"left":"right":e<0?"up":"down")}switch(i){case"left":return`← ${r}`;case"right":return`${r} →`;case"up":return"right"===e?`${r} ↑`:`↑ ${r}`;case"down":return"right"===e?`${r} ↓`:`↓ ${r}`}return r}}function yf(t="auto"){return!Li(t)&&("boolean"==typeof t?t:Bo(t,"labelArrow",["auto","up","right","down","left"]))}function gf(t){return gi(t.domain())}function vf(t,n){if(null==n)return n;const e=t(n);if(!e)throw new Error(`scale not found: ${n}`);return e}function xf(t,n={},e){let{columns:r,tickFormat:o,fontVariant:i=Lc(t),swatchSize:a=15,swatchWidth:l=a,swatchHeight:s=a,marginLeft:c=0,className:u,style:f,width:h}=n;const d=Za(n);u=Gs(u),o=sf(t.scale,t.domain,void 0,o);const p=Ja("div",d).attr("class",`${u}-swatches ${u}-swatches-${null!=r?"columns":"wrap"}`);let m;return null!=r?(m=`:where(.${u}-swatches-columns .${u}-swatch) {\n display: flex;\n align-items: center;\n break-inside: avoid;\n padding-bottom: 1px;\n}\n:where(.${u}-swatches-columns .${u}-swatch::before) {\n flex-shrink: 0;\n}\n:where(.${u}-swatches-columns .${u}-swatch-label) {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}`,p.style("columns",r).selectAll().data(t.domain).enter().append("div").attr("class",`${u}-swatch`).call(e,t,l,s).call((t=>t.append("div").attr("class",`${u}-swatch-label`).attr("title",o).text(o)))):(m=`:where(.${u}-swatches-wrap) {\n display: flex;\n align-items: center;\n min-height: 33px;\n flex-wrap: wrap;\n}\n:where(.${u}-swatches-wrap .${u}-swatch) {\n display: inline-flex;\n align-items: center;\n margin-right: 1em;\n}`,p.selectAll().data(t.domain).enter().append("span").attr("class",`${u}-swatch`).call(e,t,l,s).append((function(){return this.ownerDocument.createTextNode(o.apply(this,arguments))}))),p.call((t=>t.insert("style","*").text(`:where(.${u}-swatches) {\n font-family: system-ui, sans-serif;\n font-size: 10px;\n margin-bottom: 0.5em;\n}\n:where(.${u}-swatch > svg) {\n margin-right: 0.5em;\n overflow: visible;\n}\n${m}`))).style("margin-left",c?+c+"px":null).style("width",void 0===h?null:+h+"px").style("font-variant",Ys(i,"normal")).call(Zs,f).node()}const wf=new Map([["symbol",function(t,{fill:n=(void 0!==t.hint?.fill?t.hint.fill:"none"),fillOpacity:e=1,stroke:r=(void 0!==t.hint?.stroke?t.hint.stroke:Li(n)?"currentColor":"none"),strokeOpacity:o=1,strokeWidth:i=1.5,r:a=4.5,...l}={},s){const[c,u]=Io(n),[f,h]=Io(r),d=vf(s,c),p=vf(s,f),m=a*a*Math.PI;return e=Wo(e)[1],o=Wo(o)[1],i=Wo(i)[1],xf(t,l,((n,r,a,l)=>n.append("svg").attr("viewBox","-8 -8 16 16").attr("width",a).attr("height",l).attr("fill","color"===c?t=>d.scale(t):u).attr("fill-opacity",e).attr("stroke","color"===f?t=>p.scale(t):h).attr("stroke-opacity",o).attr("stroke-width",i).append("path").attr("d",(n=>{const e=je();return t.scale(n).draw(e,m),e}))))}],["color",$f],["opacity",function({type:t,interpolate:n,...e},{legend:r=!0,color:o=Be(0,0,0),...i}){if(!n)throw new Error(`${t} opacity scales are not supported`);!0===r&&(r="ramp");if("ramp"!==`${r}`.toLowerCase())throw new Error(`${r} opacity legends are not supported`);return $f({type:t,...e,interpolate:Mf(o)},{legend:r,...i})}]]);function bf(t={}){for(const[n,e]of wf){const r=t[n];if(Yo(r)){const o=Za(t);let i;if("symbol"===n){const{fill:n,stroke:e=(void 0===n&&Yo(t.color)?"color":void 0)}=t;i={fill:n,stroke:e}}return e(us(n,r,i),kf(o,r,t),(n=>Yo(t[n])?us(n,t[n]):null))}}throw new Error("unknown legend type; no scale found")}function kf({className:t,...n},{label:e,ticks:r,tickFormat:o}={},i){return function(t={},...n){let e=t;for(const r of n)for(const n in r)if(void 0===e[n]){const o=r[n];e===t?e={...e,[n]:o}:e[n]=o}return e}(i,{className:t,...n},{label:e,ticks:r,tickFormat:o})}function $f(t,{legend:n=!0,...e}){if(!0===n&&(n="ordinal"===t.type?"swatches":"ramp"),void 0!==t.domain)switch(`${n}`.toLowerCase()){case"swatches":return function(t,{opacity:n,...e}={}){if(!ys(t)&&!gs(t))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${t.type})`);return xf(t,e,((t,e,r,o)=>t.append("svg").attr("width",r).attr("height",o).attr("fill",e.scale).attr("fill-opacity",Wo(n)[1]).append("rect").attr("width","100%").attr("height","100%")))}(t,e);case"ramp":return function(t,n){let{label:e=t.label,tickSize:r=6,width:o=240,height:i=44+r,marginTop:a=18,marginRight:l=0,marginBottom:s=16+r,marginLeft:c=0,style:u,ticks:f=(o-c-l)/64,tickFormat:h,fontVariant:d=Lc(t),round:p=!0,opacity:m,className:y}=n;const g=Za(n);y=Gs(y),m=Wo(m)[1],null===h&&(h=()=>null);const v=Ja("svg",g).attr("class",`${y}-ramp`).attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("width",o).attr("height",i).attr("viewBox",`0 0 ${o} ${i}`).call((t=>t.append("style").text(`:where(.${y}-ramp) {\n display: block;\n height: auto;\n height: intrinsic;\n max-width: 100%;\n overflow: visible;\n}\n:where(.${y}-ramp text) {\n white-space: pre;\n}`))).call(Zs,u);let x,w=t=>t.selectAll(".tick line").attr("y1",a+s-i);const b=p?(t,n)=>t.rangeRound(n):(t,n)=>t.range(n),{type:k,domain:$,range:M,interpolate:L,scale:A,pivot:E}=t;if(L){const t=void 0===M?L:de(1===L.length?Dl(L):L,M);x=b(A.copy(),Ct(ce(c,o-l),Math.min($.length+(void 0!==E),void 0===M?1/0:M.length)));const n=256,e=g.document.createElement("canvas");e.width=n,e.height=1;const r=e.getContext("2d");for(let e=0,o=n-1;et:"string"==typeof h?Ie(h):h;x=b(ee().domain([-1,M.length-1]),[c,o-l]),v.append("g").attr("fill-opacity",m).selectAll().data(M).enter().append("rect").attr("x",((t,n)=>x(n-1))).attr("y",a).attr("width",((t,n)=>x(n)-x(n-1))).attr("height",i-a-s).attr("fill",(t=>t)),f=Do(t,((t,n)=>n)),h=e=>n(t[e],e)}else x=b(ze().domain($),[c,o-l]),v.append("g").attr("fill-opacity",m).selectAll().data($).enter().append("rect").attr("x",x).attr("y",a).attr("width",Math.max(0,x.bandwidth()-1)).attr("height",i-a-s).attr("fill",A),w=()=>{};return v.append("g").attr("transform",`translate(0,${i-s})`).call(We(x).ticks(Array.isArray(f)?null:f,"string"==typeof h?h:void 0).tickFormat("function"==typeof h?h:void 0).tickSize(r).tickValues(Array.isArray(f)?f:null)).attr("font-size",null).attr("font-family",null).attr("font-variant",Ys(d,"normal")).call(w).call((t=>t.select(".domain").remove())),void 0!==e&&v.append("text").attr("x",c).attr("y",a-6).attr("fill","currentColor").attr("font-weight","bold").text(e),v.node()}(t,e);default:throw new Error(`unknown legend type: ${n}`)}}function Mf(t){const{r:n,g:e,b:r}=Be(t)||Be(0,0,0);return t=>`rgba(${n},${e},${r},${t})`}const Lf={ariaLabel:"frame",fill:"none",stroke:"currentColor",clip:!1},Af={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square",clip:!1};class Ef extends dc{constructor(t={}){const{anchor:n=null,inset:e=0,insetTop:r=e,insetRight:o=e,insetBottom:i=e,insetLeft:a=e,rx:l,ry:s}=t;super(vo,void 0,t,null==n?Lf:Af),this.anchor=jo(n,"anchor",["top","right","bottom","left"]),this.insetTop=Lo(r),this.insetRight=Lo(o),this.insetBottom=Lo(i),this.insetLeft=Lo(a),this.rx=Lo(l),this.ry=Lo(s)}render(t,n,e,r,o){const{marginTop:i,marginRight:a,marginBottom:l,marginLeft:s,width:c,height:u}=r,{anchor:f,insetTop:h,insetRight:d,insetBottom:p,insetLeft:m,rx:y,ry:g}=this,v=s+m,x=c-a-d,w=i+h,b=u-l-p;return Ja(f?"svg:line":"svg:rect",o).datum(0).call(qs,this,r,o).call(_s,this).call(js,this,e).call(Hs,this,{}).call("left"===f?t=>t.attr("x1",v).attr("x2",v).attr("y1",w).attr("y2",b):"right"===f?t=>t.attr("x1",x).attr("x2",x).attr("y1",w).attr("y2",b):"top"===f?t=>t.attr("x1",v).attr("x2",x).attr("y1",w).attr("y2",w):"bottom"===f?t=>t.attr("x1",v).attr("x2",x).attr("y1",b).attr("y2",b):t=>t.attr("x",v).attr("y",w).attr("width",x-v).attr("height",b-w).attr("rx",y).attr("ry",g)).node()}}function zf(t){return new Ef(t)}const Of={ariaLabel:"tip",fill:"var(--plot-background)",stroke:"currentColor"},Sf=new Set(["geometry","href","src","ariaLabel","scales"]);class Nf extends dc{constructor(t,n={}){n.tip&&(n={...n,tip:!1}),void 0===n.title&&pi(t)&&mi(t)&&(n={...n,title:bo});const{x:e,y:r,x1:o,x2:i,y1:a,y2:l,anchor:s,preferredAnchor:c="bottom",monospace:u,fontFamily:f=(u?"ui-monospace, monospace":void 0),fontSize:h,fontStyle:d,fontVariant:p,fontWeight:m,lineHeight:y=1,lineWidth:g=20,frameAnchor:v,format:x,textAnchor:w="start",textOverflow:b,textPadding:k=8,title:$,pointerSize:M=12,pathFilter:L="drop-shadow(0 3px 4px rgba(0,0,0,0.2))"}=n;super(t,{x:{value:null!=o&&null!=i?null:e,scale:"x",optional:!0},y:{value:null!=a&&null!=l?null:r,scale:"y",optional:!0},x1:{value:o,scale:"x",optional:null==i},y1:{value:a,scale:"y",optional:null==l},x2:{value:i,scale:"x",optional:null==o},y2:{value:l,scale:"y",optional:null==a},title:{value:$,optional:!0}},n,Of),this.anchor=Ei(s,"anchor"),this.preferredAnchor=Ei(c,"preferredAnchor"),this.frameAnchor=zi(v),this.textAnchor=Ys(w,"middle"),this.textPadding=+k,this.pointerSize=+M,this.pathFilter=Mo(L),this.lineHeight=+y,this.lineWidth=+g,this.textOverflow=au(b),this.monospace=!!u,this.fontFamily=Mo(f),this.fontSize=Lo(h),this.fontStyle=Mo(d),this.fontVariant=Mo(p),this.fontWeight=Mo(m);for(const t in Of)t in this.channels&&(this[t]=Of[t]);this.splitLines=gu(this),this.clipLine=vu(this),this.format={...x}}render(t,n,e,r,o){const i=this,{x:a,y:l,fx:s,fy:c}=n,{ownerSVGElement:u,document:f}=o,{anchor:h,monospace:d,lineHeight:p,lineWidth:m}=this,{textPadding:y,pointerSize:g,pathFilter:v}=this,{marginTop:x,marginLeft:w}=r,{x1:b,y1:k,x2:$,y2:M,x:L=b??$,y:A=k??M}=e,E=s?s(t.fx)-w:0,z=c?c(t.fy)-x:0,[O,S]=Js(this,r),N=$c(e,O),C=Mc(e,S),T=d?yu:mu,R=T(xu);let I,W;"title"in e?(I=e.channels,W=If):(I=Tf.call(this,e,n),W=Wf);const j=Ja("svg:g",o).call(qs,this,r,o).call(fu,this).call(Hs,this,{x:L&&a,y:A&&l}).call((r=>r.selectAll().data(t).enter().append("g").attr("transform",(t=>`translate(${Math.round(N(t))},${Math.round(C(t))})`)).call(_s,this).call((t=>t.append("path").attr("filter",v))).call((r=>r.append("text").each((function(r){const o=ht(this);this.setAttribute("fill","currentColor"),this.setAttribute("fill-opacity",1),this.setAttribute("stroke","none");const a=W.call(i,r,t,I,n,e);if("string"==typeof a)for(const t of i.splitLines(a))B(o,{value:i.clipLine(t)});else{const t=new Set;for(const n of a){const{label:e=""}=n;e&&t.has(e)||(t.add(e),B(o,n))}}}))))));function B(t,{label:n,value:e,color:r,opacity:o}){n??="",e??="";const i=null!=r||null!=o;let a,l=100*m;const[s]=wu(n,l,T,R);if(s>=0)n=n.slice(0,s).trimEnd()+xu,a=e.trim(),e="";else{(n||!e&&!i)&&(e=" "+e);const[t]=wu(e,l-T(n),T,R);t>=0&&(a=e.trim(),e=e.slice(0,t).trimEnd()+xu)}const c=t.append("tspan").attr("x",0).attr("dy",`${p}em`).text("​");n&&c.append("tspan").attr("font-weight","bold").text(n),e&&c.append((()=>f.createTextNode(e))),i&&c.append("tspan").text(" ■").attr("fill",r).attr("fill-opacity",o).style("user-select","none"),a&&c.append("title").text(a)}function F(){const{width:t,height:n}=r.facet??r;j.selectChildren().each((function(e){let{x:r,width:o,height:a}=this.getBBox();o=Math.round(o),a=Math.round(a);let l=h;if(void 0===l){const r=N(e)+E,s=C(e)+z,c=r+o+g+2*y0,f=s+a+g+2*y0;l=c&&u?f&&h?i.preferredAnchor:h?"bottom":"top":f&&h?c?"left":"right":(c||u)&&(f||h)?`${h?"bottom":"top"}-${c?"left":"right"}`:i.preferredAnchor}const s=this.firstChild,c=this.lastChild;if(s.setAttribute("d",function(t,n,e,r,o){const i=r+2*e,a=o+2*e;switch(t){case"middle":return`M${-i/2},${-a/2}h${i}v${a}h${-i}z`;case"top-left":return`M0,0l${n},${n}h${i-n}v${a}h${-i}z`;case"top":return`M0,0l${n/2},${n/2}h${(i-n)/2}v${a}h${-i}v${-a}h${(i-n)/2}z`;case"top-right":return`M0,0l${-n},${n}h${n-i}v${a}h${i}z`;case"right":return`M0,0l${-n/2},${-n/2}v${n/2-a/2}h${-i}v${a}h${i}v${n/2-a/2}z`;case"bottom-left":return`M0,0l${n},${-n}h${i-n}v${-a}h${-i}z`;case"bottom":return`M0,0l${n/2},${-n/2}h${(i-n)/2}v${-a}h${-i}v${a}h${(i-n)/2}z`;case"bottom-right":return`M0,0l${-n},${-n}h${n-i}v${-a}h${i}z`;case"left":return`M0,0l${n/2},${-n/2}v${n/2-a/2}h${i}v${a}h${-i}v${n/2-a/2}z`}}(l,g,y,o,a)),r)for(const t of c.childNodes)t.setAttribute("x",-r);c.setAttribute("y",+function(t,n,e){return/^top(?:-|$)/.test(t)?.94-e:-.29-n*e}(l,c.childNodes.length,p).toFixed(6)+"em"),c.setAttribute("transform",`translate(${function(t,n,e,r,o){switch(t){case"middle":return[-r/2,o/2];case"top-left":return[e,n+e];case"top":return[-r/2,n/2+e];case"top-right":return[-r-e,n+e];case"right":return[-n/2-r-e,o/2];case"bottom-left":return[e,-n-e];case"bottom":return[-r/2,-n/2-e];case"bottom-right":return[-r-e,-n-e];case"left":return[e+n/2,o/2]}}(l,g,y,o,a)})`)})),j.attr("visibility",null)}return t.length&&(j.attr("visibility","hidden"),u.isConnected?Promise.resolve().then(F):"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(F)),j.node()}}function Cf(t,{x:n,y:e,...r}={}){return void 0===r.frameAnchor&&([n,e]=Zo(n,e)),new Nf(t,{...r,x:n,y:e})}function Tf({channels:t},n){const e={};let r=this.format;r=Rf(r,t,"x"),r=Rf(r,t,"y"),this.format=r;for(const n in r){const o=r[n];if(null!==o&&!1!==o)if("fx"===n||"fy"===n)e[n]=!0;else{const r=Ga(t,n);r&&(e[n]=r)}}for(const n in t){if(n in e||n in r||Sf.has(n))continue;const o=Ga(t,n);o&&(e[n]=o)}this.facet&&(n.fx&&!("fx"in r)&&(e.fx=!0),n.fy&&!("fy"in r)&&(e.fy=!0));for(const t in e){const r=this.format[t];if("string"==typeof r){const o=e[t]?.value??n[t]?.domain()??[];this.format[t]=(gi(o)?R:Ie)(r)}else if(void 0===r||!0===r){const e=n[t];this.format[t]=e?.bandwidth?sf(e,e.domain()):Ss}}return e}function Rf(t,n,e){if(!(e in t))return t;const r=`${e}1`,o=`${e}2`;if(!(!(r in t)&&r in n||!(o in t)&&o in n))return t;const i=Object.entries(t),a=t[e];return i.splice(i.findIndex((([t])=>t===e))+1,0,[r,a],[o,a]),Object.fromEntries(i)}function If(t,n,{title:e}){return Ss(e.value[t],t)}function*Wf(t,n,e,r,o){for(const i in e){if("fx"===i||"fy"===i){yield{label:Ff(r,e,i),value:this.format[i](n[i],t)};continue}if("x1"===i&&"x2"in e)continue;if("y1"===i&&"y2"in e)continue;const a=e[i];if("x2"===i&&"x1"in e)yield{label:Bf(r,e,"x"),value:jf(this.format.x2,e.x1,a,t)};else if("y2"===i&&"y1"in e)yield{label:Bf(r,e,"y"),value:jf(this.format.y2,e.y1,a,t)};else{const n=a.value[t],l=a.scale;if(!Tr(n)&&null==l)continue;yield{label:Ff(r,e,i),value:this.format[i](n,t),color:"color"===l?o[i][t]:null,opacity:"opacity"===l?o[i][t]:null}}}}function jf(t,n,e,r){return e.hint?.length?`${t(e.value[r]-n.value[r],r)}`:`${t(n.value[r],r)}–${t(e.value[r],r)}`}function Bf(t,n,e){const r=Ff(t,n,`${e}1`,e),o=Ff(t,n,`${e}2`,e);return r===o?r:`${r}–${o}`}function Ff(t,n,e,r=e){const o=n[e],i=t[o?.scale??e];return String(i?.label??o?.label??r)}function Df(t={}){const{facet:n,style:e,title:r,subtitle:o,caption:i,ariaLabel:a,ariaDescription:l}=t,s=Gs(t.className),c=void 0===t.marks?[]:_f(t.marks);c.push(...function(t){const n=[];for(const e of t){let t=e.tip;if(t){!0===t?t={}:"string"==typeof t&&(t={pointer:t});let{pointer:r,preferredAnchor:o}=t;r=/^x$/i.test(r)?bc:/^y$/i.test(r)?kc:wc,t=r(Jf(e,t)),t.title=null,void 0===o&&(t.preferredAnchor=r===kc?"left":"bottom");const i=Cf(e.data,t);i.facet=e.facet,i.facetAnchor=e.facetAnchor,n.push(i)}}return n}(c));const u=function(t,n){if(null==t)return;const{x:e,y:r}=t;if(null==e&&null==r)return;const o=Fo(t.data);if(null==o)throw new Error("missing facet data");const i={};null!=e&&(i.fx=Ba(o,{value:e,scale:"fx"}));null!=r&&(i.fy=Ba(o,{value:r,scale:"fy"}));Hf(i,n);const a=tc(o,i);return{channels:i,groups:a,data:t.data}}(n,t),f=new Map;for(const n of c){const e=Zf(n,u,t);e&&f.set(n,e)}const h=new Map;u&&Xf(h,[u],t),Xf(h,f,t);const d=_f(function(t,n,e){let{projection:r,x:o={},y:i={},fx:a={},fy:l={},axis:s,grid:c,facet:u={},facet:{axis:f=s,grid:h}=u,x:{axis:d=s,grid:p=(null===d?null:c)}=o,y:{axis:m=s,grid:y=(null===m?null:c)}=i,fx:{axis:g=f,grid:v=(null===g?null:h)}=a,fy:{axis:x=f,grid:w=(null===x?null:h)}=l}=e;(r||!Yo(o)&&!eh("x",t))&&(d=p=null);(r||!Yo(i)&&!eh("y",t))&&(m=y=null);n.has("fx")||(g=v=null);n.has("fy")||(x=w=null);void 0===d&&(d=!nh(t,"x"));void 0===m&&(m=!nh(t,"y"));void 0===g&&(g=!nh(t,"fx"));void 0===x&&(x=!nh(t,"fy"));!0===d&&(d="bottom");!0===m&&(m="left");!0===g&&(g="top"===d||null===d?"bottom":"top");!0===x&&(x="right"===m||null===m?"left":"right");const b=[];return Qf(b,w,Ku,l),Kf(b,x,Yu,"right","left",u,l),Qf(b,v,tf,a),Kf(b,g,Xu,"top","bottom",u,a),Qf(b,y,Ju,i),Kf(b,m,Hu,"left","right",e,i),Qf(b,p,Qu,o),Kf(b,d,Uu,"bottom","top",e,o),b}(c,h,t));for(const n of d){const e=Zf(n,u,t);e&&f.set(n,e)}c.unshift(...d);let p=function(t,n){const{fx:e,fy:r}=ts(t,n),o=e?.scale.domain(),i=r?.scale.domain();return o&&i?Ce(o,i).map((([t,n],e)=>({x:t,y:n,i:e}))):o?o.map(((t,n)=>({x:t,i:n}))):i?i.map(((t,n)=>({y:t,i:n}))):void 0}(h,t);if(void 0!==p){const t=u?hc(p,u):void 0;for(const n of c){if(null===n.facet||"super"===n.facet)continue;const e=f.get(n);void 0!==e&&(e.facetsIndex=null!=n.fx||null!=n.fy?hc(p,e):t)}const n=new Set;for(const{facetsIndex:t}of f.values())t?.forEach(((t,e)=>{t?.length>0&&n.add(e)}));p.forEach(0t.empty=!n.has(e):t=>t.empty=!1);for(const t of c)if("exclude"===t.facet){const n=f.get(t);void 0!==n&&(n.facetsIndex=nc(n.facetsIndex))}}for(const n of Bi.keys())Yo(t[n])&&"fx"!==n&&"fy"!==n&&h.set(n,[]);const m=new Map;for(const n of c){if(m.has(n))throw new Error("duplicate mark; each mark must be unique");const{facetsIndex:e,channels:r}=f.get(n)??{},{data:o,facets:i,channels:a}=n.initialize(e,r,t);Hf(a,t),m.set(n,{data:o,facets:i,channels:a})}const y=ts(Xf(h,m,t),t),g=function(t,n,e={}){let r=.5-Ns,o=.5+Ns,i=.5+Ns,a=.5-Ns;for(const{marginTop:t,marginRight:e,marginBottom:l,marginLeft:s}of n)t>r&&(r=t),e>o&&(o=e),l>i&&(i=l),s>a&&(a=s);let{margin:l,marginTop:s=(void 0!==l?l:r),marginRight:c=(void 0!==l?l:o),marginBottom:u=(void 0!==l?l:i),marginLeft:f=(void 0!==l?l:a)}=e;s=+s,c=+c,u=+u,f=+f;let{width:h=640,height:d=Ks(t,e,{width:h,marginTopDefault:r,marginRightDefault:o,marginBottomDefault:i,marginLeftDefault:a})+Math.max(0,s-r+u-i)}=e;h=+h,d=+d;const p={width:h,height:d,marginTop:s,marginRight:c,marginBottom:u,marginLeft:f};if(t.fx||t.fy){let{margin:t,marginTop:n=(void 0!==t?t:s),marginRight:r=(void 0!==t?t:c),marginBottom:o=(void 0!==t?t:u),marginLeft:i=(void 0!==t?t:f)}=e.facet??{};n=+n,r=+r,o=+o,i=+i,p.facet={marginTop:n,marginRight:r,marginBottom:o,marginLeft:i}}return p}(y,c,t);!function(t,n){const{x:e,y:r,fx:o,fy:i}=t,a=o||i?os(n):n;o&&as(o,a),i&&ls(i,a);const l=o||i?is(t,n):n;e&&as(e,l),r&&ls(r,l)}(y,g);const v=ns(y),{fx:x,fy:w}=v,b=x||w?is(y,g):g,k=x||w?function({fx:t,fy:n},e){const{marginTop:r,marginRight:o,marginBottom:i,marginLeft:a,width:l,height:s}=os(e),c=t&&rh(t),u=n&&rh(n);return{marginTop:n?u[0]:r,marginRight:t?l-c[1]:o,marginBottom:n?s-u[1]:i,marginLeft:t?c[0]:a,inset:{marginTop:e.marginTop,marginRight:e.marginRight,marginBottom:e.marginBottom,marginLeft:e.marginLeft},width:l,height:s}}(v,g):g,$=Za(t),M=$.document,L=dt("svg").call(M.documentElement);let A=L;$.ownerSVGElement=L,$.className=s,$.projection=ol(t,b),$.filterFacets=(t,n)=>hc(p,{channels:n,groups:tc(t,n)}),$.getMarkState=t=>{const n=m.get(t),e=f.get(t);return{...n,channels:{...n.channels,...e?.channels}}},$.dispatchValue=t=>{A.value!==t&&(A.value=t,A.dispatchEvent(new Event("input",{bubbles:!0})))};const E=new Set;for(const[n,e]of m)if(null!=n.initializer){const r="super"===n.facet?k:b,o=n.initializer(e.data,e.facets,e.channels,v,r,$);if(void 0!==o.data&&(e.data=o.data),void 0!==o.facets&&(e.facets=o.facets),void 0!==o.channels){const{fx:r,fy:i,...a}=o.channels;Uf(a),Object.assign(e.channels,a);for(const n of Object.values(a)){const{scale:e}=n;null!=e&&((z=Bi.get(e))!==Ni&&z!==ji)&&(Yf(n,t),E.add(e))}null==r&&null==i||f.set(n,!0)}}var z;if(E.size){const n=new Map;Xf(n,m,t,(t=>E.has(t))),Xf(h,m,t,(t=>E.has(t)));const e=function(t,n){for(const e in t){const r=t[e],o=n[e];void 0===r.label&&o&&(r.label=o.label)}return t}(ts(n,t),y),{scales:r,...o}=ns(e);Object.assign(y,e),Object.assign(v,o),Object.assign(v.scales,r)}let O,S;void 0!==p&&(O={x:x?.domain(),y:w?.domain()},p=function(t,{x:n,y:e}){return n&&=oc(n),e&&=oc(e),t.filter(n&&e?t=>n.has(t.x)&&e.has(t.y):n?t=>n.has(t.x):t=>e.has(t.y)).sort(n&&e?(t,r)=>n.get(t.x)-n.get(r.x)||e.get(t.y)-e.get(r.y):n?(t,e)=>n.get(t.x)-n.get(e.x):(t,n)=>e.get(t.y)-e.get(n.y))}(p,O),S=function(t,n,{marginTop:e,marginLeft:r}){return t&&n?({x:o,y:i})=>`translate(${t(o)-r},${n(i)-e})`:t?({x:n})=>`translate(${t(n)-r},0)`:({y:t})=>`translate(0,${n(t)-e})`}(x,w,g));for(const[t,n]of m)n.values=t.scale(n.channels,v,$);const{width:N,height:C}=g;ht(L).attr("class",s).attr("fill","currentColor").attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("text-anchor","middle").attr("width",N).attr("height",C).attr("viewBox",`0 0 ${N} ${C}`).attr("aria-label",a).attr("aria-description",l).call((t=>t.append("style").text(`:where(.${s}) {\n --plot-background: white;\n display: block;\n height: auto;\n height: intrinsic;\n max-width: 100%;\n}\n:where(.${s} text),\n:where(.${s} tspan) {\n white-space: pre;\n}`))).call(Zs,e);for(const t of c){const{channels:n,values:e,facets:r}=m.get(t);if(void 0===p||"super"===t.facet){let o=null;if(r&&(o=r[0],o=t.filter(o,n,e),0===o.length))continue;const i=t.render(o,v,e,k,$);if(null==i)continue;L.appendChild(i)}else{let o;for(const i of p){if(!(t.facetAnchor?.(p,O,i)??!i.empty))continue;let a=null;if(r){const o=f.has(t);if(a=r[o?i.i:0],a=t.filter(a,n,e),0===a.length)continue;o||a!==r[0]||(a=ni(a)),a.fx=i.x,a.fy=i.y,a.fi=i.i}const l=t.render(a,v,e,b,$);if(null!=l){(o??=ht(L).append("g")).append((()=>l)).datum(i);for(const t of["aria-label","aria-description","aria-hidden","transform"])l.hasAttribute(t)&&(o.attr(t,l.getAttribute(t)),l.removeAttribute(t))}}o?.selectChildren().attr("transform",S)}}const T=function(t,n,e){const r=[];for(const[o,i]of wf){const a=e[o];if(a?.legend&&o in t){const e=i(t[o],kf(n,t[o],a),(n=>t[n]));null!=e&&r.push(e)}}return r}(y,$,t),{figure:R=null!=r||null!=o||null!=i||T.length>0}=t;R&&(A=M.createElement("figure"),A.className=`${s}-figure`,A.style.maxWidth="initial",null!=r&&A.append(qf(M,r,"h2")),null!=o&&A.append(qf(M,o,"h3")),A.append(...T,L),null!=i&&A.append(function(t,n){const e=t.createElement("figcaption");return e.append(n),e}(M,i))),A.scale=function(t){return n=>{if(!Bi.has(n=`${n}`))throw new Error(`unknown scale: ${n}`);return t[n]}}(v.scales),A.legend=function(t,n,e={}){return(r,o)=>{if(!wf.has(r))throw new Error(`unknown legend type: ${r}`);if(r in t)return wf.get(r)(t[r],kf(n,e[r],o),(n=>t[n]))}}(y,$,t);const I=function(){const t=Qa;return Qa=0,Ka=void 0,t}();return I>0&&ht(L).append("text").attr("x",N).attr("y",20).attr("dy","-1em").attr("text-anchor","end").attr("font-family","initial").text("⚠️").append("title").text(`${I.toLocaleString("en-US")} warning${1===I?"":"s"}. Please check the console.`),A}function qf(t,n,e){if(n.ownerDocument)return n;const r=t.createElement(e);return r.append(n),r}function _f(t){return t.flat(1/0).filter((t=>null!=t)).map(Pf)}function Pf(t){return"function"==typeof t.render?t:new Vf(t)}dc.prototype.plot=function({marks:t=[],...n}={}){return Df({...n,marks:[...t,this]})};class Vf extends dc{constructor(t){if("function"!=typeof t)throw new TypeError("invalid mark; missing render function");super(),this.render=t}render(){}}function Hf(t,n){for(const e in t)Yf(t[e],n);return t}function Yf(t,n){const{scale:e,transform:r=!0}=t;if(null==e||!r)return;const{type:o,percent:i,interval:a,transform:l=(i?t=>100*t:ci(a,o))}=n[e]??{};null!=l&&(t.value=Do(t.value,l),t.transform=!1)}function Uf(t){for(const n in t)qa(n,t[n])}function Xf(t,n,e,r=$o){for(const{channels:o}of n.values())for(const n in o){const i=o[n],{scale:a}=i;if(null!=a&&r(a))if("projection"===a){if(!fl(e)){const n=void 0===e.x?.domain,r=void 0===e.y?.domain;if(n||r){const[e,o]=dl(i);n&&Gf(t,"x",e),r&&Gf(t,"y",o)}}}else Gf(t,a,i)}return t}function Gf(t,n,e){const r=t.get(n);void 0!==r?r.push(e):t.set(n,[e])}function Zf(t,n,e){if(null===t.facet||"super"===t.facet)return;const{fx:r,fy:o}=t;if(null!=r||null!=o){const n=Fo(t.data??r??o);if(void 0===n)throw new Error(`missing facet data in ${t.ariaLabel}`);if(null===n)return;const i={};return null!=r&&(i.fx=Ba(n,{value:r,scale:"fx"})),null!=o&&(i.fy=Ba(n,{value:o,scale:"fy"})),Hf(i,e),{channels:i,groups:tc(n,i)}}if(void 0===n)return;const{channels:i,groups:a,data:l}=n;if("auto"!==t.facet||t.data===l)return{channels:i,groups:a};l.length>0&&(a.size>1||1===a.size&&i.fx&&i.fy&&[...a][0][1].size>1)&&Fo(t.data)?.length===l.length&&tl(`Warning: the ${t.ariaLabel} mark appears to use faceted data, but isn’t faceted. The mark data has the same length as the facet data and the mark facet option is "auto", but the mark data and facet data are distinct. If this mark should be faceted, set the mark facet option to true; otherwise, suppress this warning by setting the mark facet option to false.`)}function Jf(t,n={}){return Yi({...n,x:null,y:null},((n,e,r,o,i,a)=>a.getMarkState(t)))}function Kf(t,n,e,r,o,i,a){if(!n)return;const l=/^\s*both\s*$/i.test(n);a=function(t,n,{line:e=n.line,ticks:r,tickSize:o,tickSpacing:i,tickPadding:a,tickFormat:l,tickRotate:s,fontVariant:c,ariaLabel:u,ariaDescription:f,label:h=n.label,labelAnchor:d,labelArrow:p=n.labelArrow,labelOffset:m}){return{anchor:t,line:e,ticks:r,tickSize:o,tickSpacing:i,tickPadding:a,tickFormat:l,tickRotate:s,fontVariant:c,ariaLabel:u,ariaDescription:f,label:h,labelAnchor:d,labelArrow:p,labelOffset:m}}(l?r:n,i,a);const{line:s}=a;e!==Hu&&e!==Uu||!s||Ai(s)||t.push(zf(function(t){const{anchor:n,line:e}=t;return{anchor:n,facetAnchor:n+"-empty",stroke:!0===e?void 0:e}}(a))),t.push(e(a)),l&&t.push(e({...a,anchor:o,label:null}))}function Qf(t,n,e,r){n&&!Ai(n)&&t.push(e(function(t,{stroke:n=($i(t)?t:void 0),ticks:e=(th(t)?t:void 0),tickSpacing:r,ariaLabel:o,ariaDescription:i}){return{stroke:n,ticks:e,tickSpacing:r,ariaLabel:o,ariaDescription:i}}(n,r)))}function th(t){switch(typeof t){case"number":return!0;case"string":return!$i(t)}return pi(t)||"function"==typeof t?.range}function nh(t,n){const e=`${n}-axis `;return t.some((t=>t.ariaLabel?.startsWith(e)))}function eh(t,n){for(const e of n)for(const n in e.channels){const{scale:r}=e.channels[n];if(r===t||"projection"===r)return!0}return!1}function rh(t){const n=t.domain();let e=t(n[0]),r=t(n[n.length-1]);return r{const u=si(mo(e,v),c?.[x]),h=mo(e,M),p=mo(e,B),y=mo(e,F),w=ka(s,{z:h,fill:p,stroke:y}),k=[],$=[],L=u&&b([]),A=h&&j([]),E=p&&q([]),z=y&&P([]),O=t&&f([]),S=t&&d([]),N=n&&m([]),C=n&&g([]),T=function(t,n,e){const r=t?.(e),o=n?.(e);return r&&o?function*(t){const n=r.bin(t);for(const[t,[i,a]]of r.entries()){const r=o.bin(n[t]);for(const[t,[n,l]]of o.entries())yield[r[t],{data:e,x1:i,y1:n,x2:a,y2:l}]}}:r?function*(t){const n=r.bin(t);for(const[t,[o,i]]of r.entries())yield[n[t],{data:e,x1:o,x2:i}]}:function*(t){const n=o.bin(t);for(const[t,[r,i]]of o.entries())yield[n[t],{data:e,y1:r,y2:i}]}}(t,n,e);let R=0;for(const t of s)t.initialize(e);a&&a.initialize(e),i&&i.initialize(e);for(const t of r){const n=[];for(const n of s)n.scope("facet",t);a&&a.scope("facet",t),i&&i.scope("facet",t);for(const[r,l]of pa(t,w))for(const[t,c]of pa(l,u))for(const[l,f]of T(c))if(w&&(f.z=r),!i||i.reduce(l,f)){n.push(R++),$.push(o.reduceIndex(l,e,f)),u&&L.push(t),h&&A.push(w===h?r:h[(l.length>0?l:c)[0]]),p&&E.push(w===p?r:p[(l.length>0?l:c)[0]]),y&&z.push(w===y?r:y[(l.length>0?l:c)[0]]),O&&(O.push(f.x1),S.push(f.x2)),N&&(N.push(f.y1),C.push(f.y2));for(const t of s)t.reduce(l,f);a&&a.reduce(l,f)}k.push(n)}return $a(k,a,l),{data:$,facets:k}})),...!ua(s,"x")&&(u?{x1:u,x2:h,x:li(u,h)}:{x:k,x1:E,x2:z}),...!ua(s,"y")&&(p?{y1:p,y2:y,y:li(p,y)}:{y:$,y1:O,y2:S}),...w&&{[x]:w},...Object.fromEntries(s.map((({name:t,output:n})=>[t,n])))}}function mh({cumulative:t,domain:n,thresholds:e,interval:r,...o},i){return[o,{cumulative:t,domain:n,thresholds:e,interval:r,...i}]}function yh(t,{cumulative:n,domain:e,thresholds:r,interval:o},i){return void 0===(t={...di(t)}).domain&&(t.domain=e),void 0===t.cumulative&&(t.cumulative=n),void 0===t.thresholds&&(t.thresholds=r),void 0===t.interval&&(t.interval=o),void 0===t.value&&(t.value=i),t.thresholds=vh(t.thresholds,t.interval),t}function gh(t){if(null==t)return;const{value:n,cumulative:e,domain:r=le,thresholds:o}=t,i=t=>{let i,a=mo(t,n);if(gi(a)||(function(t){return hi(t)&&"function"==typeof t?.floor&&t.floor()instanceof Date}(l=o)||pi(l)&&gi(l))){a=Do(a,Ro,Float64Array);let[t,n]="function"==typeof r?r(a):r,e="function"!=typeof o||hi(o)?o:o(a,t,n);"number"==typeof e&&(e=sr(t,n,e)),hi(e)&&(r===le&&(t=e.floor(t),n=e.offset(e.floor(n))),e=e.range(t,e.offset(n))),i=e}else{a=No(a);let[t,n]="function"==typeof r?r(a):r,e="function"!=typeof o||hi(o)?o:o(a,t,n);if("number"==typeof e)if(r===le){let r=cr(t,n,e);if(isFinite(r))if(r>0){let o=Math.round(t/r),i=Math.round(n/r);o*r<=t||--o,i*r>n||++i;let a=i-o+1;e=new Float64Array(a);for(let t=0;tn||++i;let a=i-o+1;e=new Float64Array(a);for(let t=0;t0?Lh:Mh)(s,i,a),s};return i.label=ai(n),i}function vh(t,n,e=$h){if(void 0===t)return void 0===n?e:fi(n);if("string"==typeof t){switch(t.toLowerCase()){case"freedman-diaconis":return lr;case"scott":return ar;case"sturges":return ir;case"auto":return $h}return io(t)}return t}function xh(t,n,e){return ha(t,n,e,wh)}function wh(t,n,e){return da(t,n,e,bh)}function bh(t,n){return ma(t,n,kh)}function kh(t){switch(`${t}`.toLowerCase()){case"x":return zh;case"x1":return Sh;case"x2":return Nh;case"y":return Oh;case"y1":return Ch;case"y2":return Th;case"z":return Wa}throw new Error(`invalid bin reduce: ${t}`)}function $h(t,n,e){return Math.min(200,ar(t,n,e))}function Mh(t,n,e){return n=No(n),r=>{const o=t.map((()=>[]));for(const t of r)o[ur(n,e[t])-1]?.push(t);return o}}function Lh(t,n,e){const r=Mh(t,n,e);return t=>{const n=r(t);for(let t=1,e=n.length;t{const n=r(t);for(let t=n.length-2;t>=0;--t){const e=n[t+1],r=n[t];for(const t of e)r.push(t)}return n}}function Eh(t,n){const e=(+t+ +n)/2;return t instanceof Date?new Date(e):e}const zh={reduceIndex:(t,n,{x1:e,x2:r})=>Eh(e,r)},Oh={reduceIndex:(t,n,{y1:e,y2:r})=>Eh(e,r)},Sh={reduceIndex:(t,n,{x1:e})=>e},Nh={reduceIndex:(t,n,{x2:e})=>e},Ch={reduceIndex:(t,n,{y1:e})=>e},Th={reduceIndex:(t,n,{y2:e})=>e};function Rh(t={}){return _o(t)?t:{...t,x:bo}}function Ih(t={}){return Po(t)?t:{...t,y:bo}}function Wh(t={},n={}){1===arguments.length&&([t,n]=Vh(t));const{y1:e,y:r=e,x:o,...i}=n,[a,l,s,c]=Yh(r,o,"y","x",t,i);return{...a,y1:e,y:l,x1:s,x2:c,x:li(s,c)}}function jh(t={},n={}){1===arguments.length&&([t,n]=Vh(t));const{y1:e,y:r=e,x:o}=n,[i,a,l]=Yh(r,o,"y","x",t,n);return{...i,y1:e,y:a,x:l}}function Bh(t={},n={}){1===arguments.length&&([t,n]=Vh(t));const{y1:e,y:r=e,x:o}=n,[i,a,,l]=Yh(r,o,"y","x",t,n);return{...i,y1:e,y:a,x:l}}function Fh(t={},n={}){1===arguments.length&&([t,n]=Vh(t));const{x1:e,x:r=e,y:o,...i}=n,[a,l,s,c]=Yh(r,o,"x","y",t,i);return{...a,x1:e,x:l,y1:s,y2:c,y:li(s,c)}}function Dh(t={},n={}){1===arguments.length&&([t,n]=Vh(t));const{x1:e,x:r=e,y:o}=n,[i,a,l]=Yh(r,o,"x","y",t,n);return{...i,x1:e,x:a,y:l}}function qh(t={},n={}){1===arguments.length&&([t,n]=Vh(t));const{x1:e,x:r=e,y:o}=n,[i,a,,l]=Yh(r,o,"x","y",t,n);return{...i,x1:e,x:a,y:l}}function _h({x:t,x1:n,x2:e,...r}={}){return r=gc(r,"y"),void 0===n&&void 0===e?Wh({x:t,...r}):([n,e]=Go(t,n,e),{...r,x1:n,x2:e})}function Ph({y:t,y1:n,y2:e,...r}={}){return r=gc(r,"x"),void 0===n&&void 0===e?Fh({y:t,...r}):([n,e]=Go(t,n,e),{...r,y1:n,y2:e})}function Vh(t){const{offset:n,order:e,reverse:r,...o}=t;return[{offset:n,order:e,reverse:r},o]}const Hh={length:!0};function Yh(t,n=ko,e,r,{offset:o,order:i,reverse:a},l){if(null===n)throw new Error(`stack requires ${r}`);const s=Jo(l),[c,u]=ii(t),[f,h]=oi(n),[d,p]=oi(n);return f.hint=d.hint=Hh,o=function(t){if(null==t)return;if("function"==typeof t)return t;switch(`${t}`.toLowerCase()){case"expand":case"normalize":return Xh;case"center":case"silhouette":return Gh;case"wiggle":return Zh}throw new Error(`unknown offset: ${t}`)}(o),i=function(t,n,e){if(void 0===t&&n===Zh)return Qh(Rr);if(null==t)return;if("string"==typeof t){const n=t.startsWith("-"),r=n?Ir:Rr;switch((n?t.slice(1):t).toLowerCase()){case"value":case e:return function(t){return(n,e,r)=>(n,e)=>t(r[n],r[e])}(r);case"z":return function(t){return(n,e,r,o)=>(n,e)=>t(o[n],o[e])}(r);case"sum":return function(t){return ed(t,((t,n,e,r)=>hr(Ko(t),(t=>tt(t,(t=>e[t]))),(t=>r[t]))))}(r);case"appearance":return function(t){return ed(t,((t,n,e,r)=>hr(Ko(t),(t=>n[dr(t,(t=>e[t]))]),(t=>r[t]))))}(r);case"inside-out":return Qh(r)}return td(xo(t))}if("function"==typeof t)return(1===t.length?td:nd)(t);if(Array.isArray(t))return r=t,ed(Rr,(()=>r));var r;throw new Error(`invalid order: ${t}`)}(i,o,r),[Hi(l,((r,l,c)=>{({data:r,facets:l}=function(t,n){if(1===n.length)return{data:t,facets:n};const e=t.length,r=new Uint8Array(e);let o=0;for(const t of n)for(const n of t)r[n]&&++o,r[n]=1;if(0===o)return{data:t,facets:n};const i=(t=qo(t))[po]=new Uint32Array(e+o);n=n.map((t=>qo(t,Uint32Array)));let a=e;r.fill(0);for(const e of n)for(let n=0,o=e.length;nf[t])).values()):[t];if(y)for(const t of n)t.sort(y);for(const t of n){let n=0,e=0;a&&t.reverse();for(const r of t){const t=d[r];t<0?n=x[r]=(v[r]=n)+t:t>0?e=x[r]=(v[r]=e)+t:x[r]=v[r]=e}}w.push(n)}return o&&o(w,v,x,m),{data:r,facets:l}})),c,f,d]}function Uh(t,n){let e=0,r=0;for(const o of t){const t=n[o];tr&&(r=t)}return[e,r]}function Xh(t,n,e){for(const r of t)for(const t of r){const[r,o]=Uh(t,e);for(const i of t){const t=1/(o-r||1);n[i]=t*(n[i]-r),e[i]=t*(e[i]-r)}}}function Gh(t,n,e){for(const r of t){for(const t of r){const[r,o]=Uh(t,e);for(const i of t){const t=(o+r)/2;n[i]-=t,e[i]-=t}}Jh(r,n,e)}Kh(t,n,e)}function Zh(t,n,e,r){for(const o of t){const t=new Te;let i=0;for(const a of o){let o=-1;const l=a.map((t=>Math.abs(e[t]-n[t]))),s=a.map((i=>{o=r?r[i]:++o;const a=e[i]-n[i],l=t.has(o)?a-t.get(o):0;return t.set(o,a),l})),c=[0,...fr(s)];for(const t of a)n[t]+=i,e[t]+=i;const u=tt(l);u&&(i-=tt(l,((t,n)=>(s[n]/2+c[n])*t))/u)}Jh(o,n,e)}Kh(t,n,e)}function Jh(t,n,e){const r=ct(t,(t=>ct(t,(t=>n[t]))));for(const o of t)for(const t of o)n[t]-=r,e[t]-=r}function Kh(t,n,e){const r=t.length;if(1===r)return;const o=t.map((t=>t.flat())),i=o.map((t=>(ct(t,(t=>n[t]))+N(t,(t=>e[t])))/2)),a=ct(i);for(let t=0;t{const o=Ko(t),i=hr(o,(t=>n[dr(t,(t=>e[t]))]),(t=>r[t])),a=Q(o,(t=>tt(t,(t=>e[t]))),(t=>r[t])),l=[],s=[];let c=0;for(const t of i)c<0?(c+=a.get(t),l.push(t)):(c-=a.get(t),s.push(t));return s.reverse().concat(l)}))}function td(t){return n=>{const e=mo(n,t);return(t,n)=>Rr(e[t],e[n])}}function nd(t){return n=>(e,r)=>t(n[e],n[r])}function ed(t,n){return(e,r,o,i)=>{if(!i)throw new Error("missing channel: z");const a=new Te(n(e,r,o,i).map(((t,n)=>[t,n])));return(n,e)=>t(a.get(i[n]),a.get(i[e]))}}const rd={ariaLabel:"area",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class od extends dc{constructor(t,n={}){const{x1:e,y1:r,x2:o,y2:i,z:a,curve:l,tension:s}=n;super(t,{x1:{value:e,scale:"x"},y1:{value:r,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:i,scale:"y",optional:!0},z:{value:Jo(n),optional:!0}},n,rd),this.z=a,this.curve=ih(l,s)}filter(t){return t}render(t,n,e,r,o){const{x1:i,y1:a,x2:l=i,y2:s=a}=e;return Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,n,0,0).call((n=>n.selectAll().data(Ds(t,[i,a,l,s],this,e)).enter().append("path").call(_s,this).call(Bs,this,e).attr("d",pr().curve(this.curve).defined((t=>t>=0)).x0((t=>i[t])).y0((t=>a[t])).x1((t=>l[t])).y1((t=>s[t]))))).node()}}function id(t,n){return void 0===n?ld(t,{x:Ao,y:Eo}):new od(t,n)}function ad(t,n){const{y:e=wo,...r}=dh(n);return new od(t,_h(Rh({...r,y1:e,y2:void 0})))}function ld(t,n){const{x:e=wo,...r}=hh(n);return new od(t,Ph(Ih({...r,x1:e,x2:void 0})))}const sd={ariaLabel:"link",fill:"none",stroke:"currentColor",strokeMiterlimit:1};class cd extends dc{constructor(t,n={}){const{x1:e,y1:r,x2:o,y2:i,curve:a,tension:l}=n;super(t,{x1:{value:e,scale:"x"},y1:{value:r,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:i,scale:"y",optional:!0}},n,sd),this.curve=ah(a,l),Ec(this,n)}project(t,n,e){this.curve!==lh&&super.project(t,n,e)}render(t,n,e,r,o){const{x1:i,y1:a,x2:l=i,y2:s=a}=e,{curve:c}=this;return Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,n).call((n=>n.selectAll().data(t).enter().append("path").call(_s,this).attr("d",c===lh&&o.projection?function(t,n,e,r,o){const i=mt(t);return n=No(n),e=No(e),r=No(r),o=No(o),t=>i({type:"LineString",coordinates:[[n[t],e[t]],[r[t],o[t]]]})}(o.projection,i,a,l,s):t=>{const n=je(),e=c(n);return e.lineStart(),e.point(i[t],a[t]),e.point(l[t],s[t]),e.lineEnd(),n}).call(js,this,e).call(Ic,this,e,o))).node()}}function ud(t,{x:n,x1:e,x2:r,y:o,y1:i,y2:a,...l}={}){return[e,r]=fd(n,e,r),[i,a]=fd(o,i,a),new cd(t,{...l,x1:e,x2:r,y1:i,y2:a})}function fd(t,n,e){if(void 0===t){if(void 0===n){if(void 0!==e)return[e]}else if(void 0===e)return[n]}else{if(void 0===n)return void 0===e?[t]:[t,e];if(void 0===e)return[t,n]}return[n,e]}const hd={ariaLabel:"arrow",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:1,strokeWidth:1.5};class dd extends dc{constructor(e,r={}){const{x1:o,y1:i,x2:a,y2:l,bend:s=0,headAngle:c=60,headLength:u=8,inset:f=0,insetStart:h=f,insetEnd:d=f,sweep:p}=r;super(e,{x1:{value:o,scale:"x"},y1:{value:i,scale:"y"},x2:{value:a,scale:"x",optional:!0},y2:{value:l,scale:"y",optional:!0}},r,hd),this.bend=!0===s?22.5:Math.max(-90,Math.min(90,s)),this.headAngle=+c,this.headLength=+u,this.insetStart=+h,this.insetEnd=+d,this.sweep=function(e=1){if("number"==typeof e)return Oo(Math.sign(e));if("function"==typeof e)return(t,n,r,o)=>Math.sign(e(t,n,r,o));switch(Bo(e,"sweep",["+x","-x","+y","-y"])){case"+x":return(n,e,r)=>t(n,r);case"-x":return(t,e,r)=>n(t,r);case"+y":return(n,e,r,o)=>t(e,o);case"-y":return(t,e,r,o)=>n(e,o)}}(p)}render(t,n,e,r,o){const{x1:i,y1:a,x2:l=i,y2:s=a,SW:c}=e,{strokeWidth:u,bend:f,headAngle:h,headLength:d,insetStart:p,insetEnd:m}=this,y=c?t=>c[t]:Oo(void 0===u?1:u),g=h*Ac/2,v=d/1.5;return Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,n).call((n=>n.selectAll().data(t).enter().append("path").call(_s,this).attr("d",(t=>{let n=i[t],e=a[t],r=l[t],o=s[t];const c=Math.hypot(r-n,o-e);if(c<=p+m)return null;let u=Math.atan2(o-e,r-n);const h=Math.min(v*y(t),c/3),d=this.sweep(n,e,r,o)*f*Ac,x=Math.hypot(c/Math.tan(d),c)/2;if(p||m)if(x<1e5){const t=Math.sign(d),[i,a]=function([t,n],[e,r],o,i){const a=e-t,l=r-n,s=Math.hypot(a,l),c=i*Math.sqrt(o*o-s*s/4)/s;return[(t+e)/2-l*c,(n+r)/2+a*c]}([n,e],[r,o],x,t);if(p&&([n,e]=pd([i,a,x],[n,e,p],-t*Math.sign(p))),m){const[n,e]=pd([i,a,x],[r,o,m],t*Math.sign(m));u+=Math.atan2(e-a,n-i)-Math.atan2(o-a,r-i),r=n,o=e}}else{const t=r-n,i=o-e,a=Math.hypot(t,i);p&&(n+=t/a*p,e+=i/a*p),m&&(r-=t/a*m,o-=i/a*m)}const w=u+d,b=w+g,k=w-g,$=r-h*Math.cos(b),M=o-h*Math.sin(b),L=r-h*Math.cos(k),A=o-h*Math.sin(k);return`M${n},${e}${x<1e5?`A${x},${x} 0,0,${d>0?1:0} `:"L"}${r},${o}${h?`M${$},${M}L${r},${o}L${L},${A}`:""}`})).call(js,this,e))).node()}}function pd([t,n,e],[r,o,i],a){const l=r-t,s=o-n,c=Math.hypot(l,s),u=(l*l+s*s-i*i+e*e)/(2*c),f=a*Math.sqrt(e*e-u*u);return[t+(l*u+s*f)/c,n+(s*u-l*f)/c]}function md(t,{x:n,x1:e,x2:r,y:o,y1:i,y2:a,...l}={}){return[e,r]=fd(n,e,r),[i,a]=fd(o,i,a),new dd(t,{...l,x1:e,x2:r,y1:i,y2:a})}class yd extends dc{constructor(t,n,e={},r){super(t,n,e,r);const{inset:o=0,insetTop:i=o,insetRight:a=o,insetBottom:l=o,insetLeft:s=o,rx:c,ry:u}=e;this.insetTop=Lo(i),this.insetRight=Lo(a),this.insetBottom=Lo(l),this.insetLeft=Lo(s),this.rx=Ys(c,"auto"),this.ry=Ys(u,"auto")}render(t,n,e,r,o){const{rx:i,ry:a}=this;return Ja("svg:g",o).call(qs,this,r,o).call(this._transform,this,n).call((o=>o.selectAll().data(t).enter().append("rect").call(_s,this).attr("x",this._x(n,e,r)).attr("width",this._width(n,e,r)).attr("y",this._y(n,e,r)).attr("height",this._height(n,e,r)).call(Vs,"rx",i).call(Vs,"ry",a).call(js,this,e))).node()}_x(t,{x:n},{marginLeft:e}){const{insetLeft:r}=this;return n?t=>n[t]+r:e+r}_y(t,{y:n},{marginTop:e}){const{insetTop:r}=this;return n?t=>n[t]+r:e+r}_width({x:t},{x:n},{marginRight:e,marginLeft:r,width:o}){const{insetLeft:i,insetRight:a}=this,l=n&&t?t.bandwidth():o-e-r;return Math.max(0,l-i-a)}_height({y:t},{y:n},{marginTop:e,marginBottom:r,height:o}){const{insetTop:i,insetBottom:a}=this,l=n&&t?t.bandwidth():o-e-r;return Math.max(0,l-i-a)}}const gd={ariaLabel:"bar"};class vd extends yd{constructor(t,n={}){const{x1:e,x2:r,y:o}=n;super(t,{x1:{value:e,scale:"x"},x2:{value:r,scale:"x"},y:{value:o,scale:"y",type:"band",optional:!0}},n,gd)}_transform(t,n,{x:e}){t.call(Hs,n,{x:e},0,0)}_x({x:t},{x1:n,x2:e},{marginLeft:r}){const{insetLeft:o}=this;return vs(t)?r+o:t=>Math.min(n[t],e[t])+o}_width({x:t},{x1:n,x2:e},{marginRight:r,marginLeft:o,width:i}){const{insetLeft:a,insetRight:l}=this;return vs(t)?i-r-o-a-l:t=>Math.max(0,Math.abs(e[t]-n[t])-a-l)}}class xd extends yd{constructor(t,n={}){const{x:e,y1:r,y2:o}=n;super(t,{y1:{value:r,scale:"y"},y2:{value:o,scale:"y"},x:{value:e,scale:"x",type:"band",optional:!0}},n,gd)}_transform(t,n,{y:e}){t.call(Hs,n,{y:e},0,0)}_y({y:t},{y1:n,y2:e},{marginTop:r}){const{insetTop:o}=this;return vs(t)?r+o:t=>Math.min(n[t],e[t])+o}_height({y:t},{y1:n,y2:e},{marginTop:r,marginBottom:o,height:i}){const{insetTop:a,insetBottom:l}=this;return vs(t)?i-r-o-a-l:t=>Math.max(0,Math.abs(e[t]-n[t])-a-l)}}function wd(t,n={}){return Vo(n)||(n={...n,y:wo,x2:bo}),new vd(t,_h(Yc(Rh(n))))}function bd(t,n={}){return Vo(n)||(n={...n,x:wo,y2:bo}),new xd(t,Ph(Uc(Ih(n))))}const kd={ariaLabel:"cell"};class $d extends yd{constructor(t,{x:n,y:e,...r}={}){super(t,{x:{value:n,scale:"x",type:"band",optional:!0},y:{value:e,scale:"y",type:"band",optional:!0}},r,kd)}_transform(t,n){t.call(Hs,n,{},0,0)}}function Md(t,{x:n,y:e,...r}={}){return[n,e]=Zo(n,e),new $d(t,{...r,x:n,y:e})}function Ld(t,{x:n=wo,fill:e,stroke:r,...o}={}){return void 0===e&&void 0===Io(r)[0]&&(e=bo),new $d(t,{...o,x:n,fill:e,stroke:r})}function Ad(t,{y:n=wo,fill:e,stroke:r,...o}={}){return void 0===e&&void 0===Io(r)[0]&&(e=bo),new $d(t,{...o,y:n,fill:e,stroke:r})}const Ed={ariaLabel:"dot",fill:"none",stroke:"currentColor",strokeWidth:1.5};function zd(t){return void 0===t.sort&&void 0===t.reverse?na({channel:"-r"},t):t}class Od extends dc{constructor(t,n={}){const{x:e,y:r,r:o,rotate:i,symbol:a=B,frameAnchor:l}=n,[s,c]=Wo(i,0),[u,f]=function(t){if(null==t||_i(t))return[void 0,t];if("string"==typeof t){const n=qi.get(`${t}`.toLowerCase());if(n)return[void 0,n]}return[t,void 0]}(a),[h,d]=Wo(o,null==u?3:4.5);super(t,{x:{value:e,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},r:{value:h,scale:"r",filter:Br,optional:!0},rotate:{value:s,optional:!0},symbol:{value:u,scale:"auto",optional:!0}},zd(n),Ed),this.r=d,this.rotate=c,this.symbol=f,this.frameAnchor=zi(l);const{channels:p}=this,{symbol:m}=p;if(m){const{fill:t,stroke:n}=p;m.hint={fill:t?t.value===m.value?"color":"currentColor":this.fill??"currentColor",stroke:n?n.value===m.value?"color":"currentColor":this.stroke??"none"}}}render(t,n,e,r,o){const{x:i,y:a}=n,{x:l,y:s,r:c,rotate:u,symbol:f}=e,{r:h,rotate:d,symbol:p}=this,[m,y]=Js(this,r),g=p===B,v=c?void 0:h*h*Math.PI;return Fr(h)&&(t=[]),Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,{x:l&&i,y:s&&a}).call((n=>n.selectAll().data(t).enter().append(g?"circle":"path").call(_s,this).call(g?t=>{t.attr("cx",l?t=>l[t]:m).attr("cy",s?t=>s[t]:y).attr("r",c?t=>c[t]:h)}:t=>{t.attr("transform",eu`translate(${l?t=>l[t]:m},${s?t=>s[t]:y})${u?t=>` rotate(${u[t]})`:d?` rotate(${d})`:""}`).attr("d",c&&f?t=>{const n=je();return f[t].draw(n,c[t]*c[t]*Math.PI),n}:c?t=>{const n=je();return p.draw(n,c[t]*c[t]*Math.PI),n}:f?t=>{const n=je();return f[t].draw(n,v),n}:(()=>{const t=je();return p.draw(t,v),t})())}).call(js,this,e))).node()}}function Sd(t,{x:n,y:e,...r}={}){return void 0===r.frameAnchor&&([n,e]=Zo(n,e)),new Od(t,{...r,x:n,y:e})}function Nd(t,{x:n=bo,...e}={}){return new Od(t,Gc({...e,x:n}))}function Cd(t,{y:n=bo,...e}={}){return new Od(t,Xc({...e,y:n}))}function Td(t,n){return Sd(t,{...n,symbol:"circle"})}function Rd(t,n){return Sd(t,{...n,symbol:"hexagon"})}const Id={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class Wd extends dc{constructor(t,n={}){const{x:e,y:r,z:o,curve:i,tension:a}=n;super(t,{x:{value:e,scale:"x"},y:{value:r,scale:"y"},z:{value:Jo(n),optional:!0}},n,Id),this.z=o,this.curve=ah(i,a),Ec(this,n)}filter(t){return t}project(t,n,e){this.curve!==lh&&super.project(t,n,e)}render(t,n,e,r,o){const{x:i,y:a}=e,{curve:l}=this;return Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,n).call((n=>n.selectAll().data(Ds(t,[i,a],this,e)).enter().append("path").call(_s,this).call(Bs,this,e).call(Wc,this,e,o).attr("d",l===lh&&o.projection?function(t,n,e){const r=mt(t);return n=No(n),e=No(e),t=>{let o=[];const i=[o];for(const r of t)-1===r?(o=[],i.push(o)):o.push([n[r],e[r]]);return r({type:"MultiLineString",coordinates:i})}}(o.projection,i,a):mr().curve(l).defined((t=>t>=0)).x((t=>i[t])).y((t=>a[t]))))).node()}}function jd(t,{x:n,y:e,...r}={}){return[n,e]=Zo(n,e),new Wd(t,{...r,x:n,y:e})}function Bd(t,{x:n=bo,y:e=wo,...r}={}){return new Wd(t,dh({...r,x:n,y:e}))}function Fd(t,{x:n=wo,y:e=bo,...r}={}){return new Wd(t,hh({...r,x:n,y:e}))}const Dd={ariaLabel:"rect"};class qd extends dc{constructor(t,n={}){const{x1:e,y1:r,x2:o,y2:i,inset:a=0,insetTop:l=a,insetRight:s=a,insetBottom:c=a,insetLeft:u=a,rx:f,ry:h}=n;super(t,{x1:{value:e,scale:"x",type:null!=e&&null==o?"band":void 0,optional:!0},y1:{value:r,scale:"y",type:null!=r&&null==i?"band":void 0,optional:!0},x2:{value:o,scale:"x",optional:!0},y2:{value:i,scale:"y",optional:!0}},n,Dd),this.insetTop=Lo(l),this.insetRight=Lo(s),this.insetBottom=Lo(c),this.insetLeft=Lo(u),this.rx=Ys(f,"auto"),this.ry=Ys(h,"auto")}render(t,n,e,r,o){const{x:i,y:a}=n,{x1:l,y1:s,x2:c,y2:u}=e,{marginTop:f,marginRight:h,marginBottom:d,marginLeft:p,width:m,height:y}=r,{projection:g}=o,{insetTop:v,insetRight:x,insetBottom:w,insetLeft:b,rx:k,ry:$}=this,M=(i?.bandwidth?i.bandwidth():0)-b-x,L=(a?.bandwidth?a.bandwidth():0)-v-w;return Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,{},0,0).call((n=>n.selectAll().data(t).enter().append("rect").call(_s,this).attr("x",!l||!g&&vs(i)?p+b:c?t=>Math.min(l[t],c[t])+b:t=>l[t]+b).attr("y",!s||!g&&vs(a)?f+v:u?t=>Math.min(s[t],u[t])+v:t=>s[t]+v).attr("width",!l||!g&&vs(i)?m-h-p-x-b:c?t=>Math.max(0,Math.abs(c[t]-l[t])+M):M).attr("height",!s||!g&&vs(a)?y-f-d-v-w:u?t=>Math.max(0,Math.abs(s[t]-u[t])+L):L).call(Vs,"rx",k).call(Vs,"ry",$).call(js,this,e))).node()}}function _d(t,n){return new qd(t,Vc(Hc(n)))}function Pd(t,n={}){return Vo(n)||(n={...n,y:wo,x2:bo,interval:1}),new qd(t,_h(Hc(Rh(n))))}function Vd(t,n={}){return Vo(n)||(n={...n,x:wo,y2:bo,interval:1}),new qd(t,Ph(Vc(Ih(n))))}function Hd(t,n){n=function({x:t,y:n,color:e,size:r,fx:o,fy:i,mark:a}={}){Uo(t)||(t=Gd(t));Uo(n)||(n=Gd(n));Uo(e)||(e=$i(e)?{color:e}:Gd(e));Uo(r)||(r=Gd(r));Uo(o)&&({value:o}=Gd(o));Uo(i)&&({value:i}=Gd(i));null!=a&&(a=`${a}`.toLowerCase());return{x:t,y:n,color:e,size:r,fx:o,fy:i,mark:a}}(n);const{x:e,y:r,color:o,size:i}=n,a=Xd(t,e),l=Xd(t,r),s=Xd(t,o),c=Xd(t,i);let u,f,h,{fx:d,fy:p,x:{value:m,reduce:y,zero:g,...v},y:{value:x,reduce:w,zero:b,...k},color:{value:$,color:M,reduce:L},size:{value:A,reduce:E},mark:z}=n;if(void 0===y&&(y=null==w&&null==m&&null==A&&null!=x?"count":null),void 0===w&&(w=null==y&&null==x&&null==A&&null!=m?"count":null),void 0!==E||null!=A||null!=L||null!=y||null!=w||null!=m&&!yi(a)||null!=x&&!yi(l)||(E="count"),void 0===g&&(g=!!Zd(y)||void 0),void 0===b&&(b=!!Zd(w)||void 0),null==m&&null==x)throw new Error("must specify x or y");if(null!=y&&null==x)throw new Error("reducing x requires y");if(null!=w&&null==m)throw new Error("reducing y requires x");switch(void 0===z&&(z=null!=A||null!=E?"dot":Zd(y)||Zd(w)||null!=L?"bar":null!=m&&null!=x?yi(a)||yi(l)||null==y&&null==w&&!Ud(a)&&!Ud(l)?"dot":"line":null!=m||null!=x?"rule":null),z){case"dot":h=Sd,f="stroke";break;case"line":h=a&&l||null!=y||null!=w?b||null!=w||a&&Ud(a)?Fd:g||null!=y||l&&Ud(l)?Bd:jd:a?Bd:Fd,f="stroke",Kd(s)&&(u=null);break;case"area":h=!b&&null==w&&(g||null!=y||l&&Ud(l))?ad:ld,f="fill",Kd(s)&&(u=null);break;case"rule":h=a?Qc:tu,f="stroke";break;case"bar":h=null!=y?yi(l)?Jd(y)&&a&&yi(a)?Md:wd:Pd:null!=w?yi(a)?Jd(w)&&l&&yi(l)?Md:bd:Vd:null!=L||null!=E?a&&yi(a)&&l&&yi(l)?Md:a&&yi(a)?bd:l&&yi(l)?wd:_d:!a||!wi(a)||l&&wi(l)?!l||!wi(l)||a&&wi(a)?Md:bd:wd,f="fill";break;default:throw new Error(`invalid mark: ${z}`)}let O,S={fx:d,fy:p,x:a??void 0,y:l??void 0,[f]:s??M,z:u,r:c??void 0,tip:!0},N={[f]:L??void 0,r:E??void 0};if(null!=y&&null!=w)throw new Error("cannot reduce both x and y");return null!=w?(N.y=w,O=yi(a)?aa:sh):null!=y?(N.x=y,O=yi(l)?la:ch):null==L&&null==E||(a&&l?O=yi(a)&&yi(l)?sa:yi(a)?ch:yi(l)?sh:uh:a?O=yi(a)?aa:sh:l&&(O=yi(l)?la:ch)),O!==uh&&O!==sh||(S.x={value:a,...v}),O!==uh&&O!==ch||(S.y={value:l,...k}),void 0===g&&(g=a&&!(O===uh||O===sh)&&(h===wd||h===ad||h===Pd||h===tu)),void 0===b&&(b=l&&!(O===uh||O===ch)&&(h===bd||h===ld||h===Vd||h===Qc)),{fx:d??null,fy:p??null,x:{value:m??null,reduce:y??null,zero:!!g,...v},y:{value:x??null,reduce:w??null,zero:!!b,...k},color:{value:$??null,reduce:L??null,...void 0!==M&&{color:M}},size:{value:A??null,reduce:E??null},mark:z,markImpl:tp[h],markOptions:S,transformImpl:tp[O],transformOptions:N,colorMode:f}}function Yd(t,n){const e=Hd(t,n),{fx:r,fy:o,x:{zero:i},y:{zero:a},markOptions:l,transformOptions:s,colorMode:c}=e,u=Qd[e.markImpl],f=Qd[e.transformImpl],h=null!=r||null!=o?zf({strokeOpacity:.1}):null,d=[i?Qc([0]):null,a?tu([0]):null],p=u(t,f?f(s,l):l);return"stroke"===c?pc(h,d,p):pc(h,p,d)}function Ud(n){let e,r;for(const o of n){if(null==o)continue;if(void 0===e){e=o;continue}const n=Math.sign(t(e,o));if(n){if(void 0!==r&&n!==r)return!1;e=o,r=n}}return!0}function Xd(t,n){const e=mo(t,n.value);return e&&(e.label=ai(n.value)),e}function Gd(t){return function(t){if(null==t)return!1;if("function"==typeof t.reduceIndex)return!0;if("function"==typeof t.reduce&&Ho(t))return!0;if(/^p\d{2}$/i.test(t))return!0;switch(`${t}`.toLowerCase()){case"first":case"last":case"count":case"distinct":case"sum":case"proportion":case"proportion-facet":case"deviation":case"min":case"min-index":case"max":case"max-index":case"mean":case"median":case"variance":case"mode":return!0}return!1}(t)?{reduce:t}:{value:t}}function Zd(t){return/^(?:distinct|count|sum|proportion)$/i.test(t)}function Jd(t){return/^(?:first|last|mode)$/i.test(t)}function Kd(t){return!!t&&new nt(t).size>t.length>>1}const Qd={dot:Sd,line:jd,lineX:Bd,lineY:Fd,areaX:ad,areaY:ld,ruleX:Qc,ruleY:tu,barX:wd,barY:bd,rect:_d,rectX:Pd,rectY:Vd,cell:Md,bin:uh,binX:sh,binY:ch,group:sa,groupX:aa,groupY:la},tp=Object.fromEntries(Object.entries(Qd).map((([t,n])=>[n,t])));function np(t,n={}){let{x:e,x1:r,x2:o}=n;void 0===e&&void 0===r&&void 0===o&&(n={...n,x:e=bo});const i={};return null!=e&&(i.x=t),null!=r&&(i.x1=t),null!=o&&(i.x2=t),rp(i,n)}function ep(t,n={}){let{y:e,y1:r,y2:o}=n;void 0===e&&void 0===r&&void 0===o&&(n={...n,y:e=bo});const i={};return null!=e&&(i.y=t),null!=r&&(i.y1=t),null!=o&&(i.y2=t),rp(i,n)}function rp(t={},n={}){const e=Jo(n),r=Object.entries(t).map((([t,e])=>{const r=ri(t,n);if(null==r)throw new Error(`missing channel: ${t}`);const[o,i]=oi(r);return{key:t,input:r,output:o,setOutput:i,map:op(e)}}));return{...Hi(n,((t,n)=>{const o=mo(t,e),i=r.map((({input:n})=>mo(t,n))),a=r.map((({setOutput:n})=>n(new Array(t.length))));for(const t of n)for(const n of o?J(t,(t=>o[t])).values():[t])r.forEach((({map:t},e)=>t.mapIndex(n,i[e],a[e])));return{data:t,facets:n}})),...Object.fromEntries(r.map((({key:t,output:n})=>[t,n])))}}function op(t){if(null==t)throw new Error("missing map");if("function"==typeof t.mapIndex)return t;if("function"==typeof t.map&&Ho(t))return function(t){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:t.map.bind(t)}}(t);if("function"==typeof t)return ip(ti(t));switch(`${t}`.toLowerCase()){case"cumsum":return ap;case"rank":return ip(((t,n)=>yr(t,(t=>n[t]))));case"quantile":return ip(((t,n)=>function(t,n){const e=gr(t,n)-1;return yr(t,n).map((t=>t/e))}(t,(t=>n[t]))))}throw new Error(`invalid map: ${t}`)}function ip(t){return{mapIndex(n,e,r){const o=t(n,e);if(o.length!==n.length)throw new Error("map function returned a mismatched length");for(let t=0,e=n.length;t0))throw new Error(`invalid k: ${n}`);return function(t="mean"){if("string"==typeof t){if(/^p\d{2}$/i.test(t))return up(So(t));switch(t.toLowerCase()){case"deviation":return up(ut);case"max":return fp(((t,n)=>N(t,(t=>n[t]))));case"mean":return dp;case"median":return up(ot);case"min":return fp(((t,n)=>ct(t,(t=>n[t]))));case"mode":return fp(((t,n)=>et(t,(t=>n[t]))));case"sum":return hp;case"variance":return up(rt);case"difference":return vp;case"ratio":return xp;case"first":return wp;case"last":return bp}}if("function"!=typeof t)throw new Error(`invalid reduce: ${t}`);return fp(ti(t))}(e)(n,function(t="middle",n){switch(`${t}`.toLowerCase()){case"middle":return n-1>>1;case"start":return 0;case"end":return n-1}throw new Error(`invalid anchor: ${t}`)}(o,n),i)}function up(t){return(n,e,r)=>r?{mapIndex(r,o,i){const a=t=>null==o[t]?NaN:+o[t];let l=0;for(let t=0;tnull==o[t]?NaN:+o[t];for(let o=-e;o<0;++o)i[r[o+e]]=t(ni(r,0,o+n),a);for(let o=0,l=r.length-e;or?{mapIndex(r,o,i){let a=0;for(let t=0;t=e;--o){const e=t[n[o]];if(Tr(e))return e}}function yp(t,n,e,r){for(let o=e+r;e=e;--o){let e=t[n[o]];if(null!==e&&!isNaN(e=+e))return e}}function vp(t,n,e){return e?{mapIndex(e,r,o){for(let i=0,a=e.length-t;iat(t)+n*(ut(t)||0),strict:e,anchor:r})}const Ap={ariaLabel:"tick",fill:null,stroke:"currentColor"};class Ep extends dc{constructor(t,n,e){super(t,n,e,Ap),Ec(this,e)}render(t,n,e,r,o){return Ja("svg:g",o).call(qs,this,r,o).call(this._transform,this,n).call((i=>i.selectAll().data(t).enter().append("line").call(_s,this).attr("x1",this._x1(n,e,r)).attr("x2",this._x2(n,e,r)).attr("y1",this._y1(n,e,r)).attr("y2",this._y2(n,e,r)).call(js,this,e).call(Ic,this,e,o))).node()}}class zp extends Ep{constructor(t,n={}){const{x:e,y:r,inset:o=0,insetTop:i=o,insetBottom:a=o}=n;super(t,{x:{value:e,scale:"x"},y:{value:r,scale:"y",type:"band",optional:!0}},n),this.insetTop=Lo(i),this.insetBottom=Lo(a)}_transform(t,n,{x:e}){t.call(Hs,n,{x:e},Ns,0)}_x1(t,{x:n}){return t=>n[t]}_x2(t,{x:n}){return t=>n[t]}_y1({y:t},{y:n},{marginTop:e}){const{insetTop:r}=this;return n&&t?t=>n[t]+r:e+r}_y2({y:t},{y:n},{height:e,marginBottom:r}){const{insetBottom:o}=this;return n&&t?e=>n[e]+t.bandwidth()-o:e-r-o}}class Op extends Ep{constructor(t,n={}){const{x:e,y:r,inset:o=0,insetRight:i=o,insetLeft:a=o}=n;super(t,{y:{value:r,scale:"y"},x:{value:e,scale:"x",type:"band",optional:!0}},n),this.insetRight=Lo(i),this.insetLeft=Lo(a)}_transform(t,n,{y:e}){t.call(Hs,n,{y:e},0,Ns)}_x1({x:t},{x:n},{marginLeft:e}){const{insetLeft:r}=this;return n&&t?t=>n[t]+r:e+r}_x2({x:t},{x:n},{width:e,marginRight:r}){const{insetRight:o}=this;return n&&t?e=>n[e]+t.bandwidth()-o:e-r-o}_y1(t,{y:n}){return t=>n[t]}_y2(t,{y:n}){return t=>n[t]}}function Sp(t,{x:n=bo,...e}={}){return new zp(t,{...e,x:n})}function Np(t,{y:n=bo,...e}={}){return new Op(t,{...e,y:n})}function Cp(t,{x:n=bo,y:e=null,fill:r="#ccc",fillOpacity:o,stroke:i="currentColor",strokeOpacity:a,strokeWidth:l=2,sort:s,...c}={}){const u=null!=e?la:ia;return pc(tu(t,u({x1:Ip,x2:Wp},{x:n,y:e,stroke:i,strokeOpacity:a,...c})),wd(t,u({x1:"p25",x2:"p75"},{x:n,y:e,fill:r,fillOpacity:o,...c})),Sp(t,u({x:"p50"},{x:n,y:e,stroke:i,strokeOpacity:a,strokeWidth:l,sort:s,...c})),Sd(t,rp({x:Rp},{x:n,y:e,z:e,stroke:i,strokeOpacity:a,...c})))}function Tp(t,{y:n=bo,x:e=null,fill:r="#ccc",fillOpacity:o,stroke:i="currentColor",strokeOpacity:a,strokeWidth:l=2,sort:s,...c}={}){const u=null!=e?aa:ia;return pc(Qc(t,u({y1:Ip,y2:Wp},{x:e,y:n,stroke:i,strokeOpacity:a,...c})),bd(t,u({y1:"p25",y2:"p75"},{x:e,y:n,fill:r,fillOpacity:o,...c})),Np(t,u({y:"p50"},{x:e,y:n,stroke:i,strokeOpacity:a,strokeWidth:l,sort:s,...c})),Sd(t,rp({y:Rp},{x:e,y:n,z:e,stroke:i,strokeOpacity:a,...c})))}function Rp(t){const n=Ip(t),e=Wp(t);return t.map((t=>te?t:NaN))}function Ip(t){const n=2.5*jp(t)-1.5*Bp(t);return ct(t,(t=>t>=n?t:NaN))}function Wp(t){const n=2.5*Bp(t)-1.5*jp(t);return N(t,(t=>t<=n?t:NaN))}function jp(t){return W(t,.25)}function Bp(t){return W(t,.75)}const Fp={ariaLabel:"raster",stroke:null,pixelSize:1};function Dp(t,n){const e=+t;if(isNaN(e))throw new Error(`invalid ${n}: ${t}`);return e}function qp(t,n){const e=Math.floor(t);if(isNaN(e))throw new Error(`invalid ${n}: ${t}`);return e}class _p extends dc{constructor(t,n,e={},r){let{width:o,height:i,x:a,y:l,x1:s=(null==a?0:void 0),y1:c=(null==l?0:void 0),x2:u=(null==a?o:void 0),y2:f=(null==l?i:void 0),pixelSize:h=r.pixelSize,blur:d=0,interpolate:p}=e;if(null!=o&&(o=qp(o,"width")),null!=i&&(i=qp(i,"height")),null!=s&&(s=Dp(s,"x1")),null!=c&&(c=Dp(c,"y1")),null!=u&&(u=Dp(u,"x2")),null!=f&&(f=Dp(f,"y2")),null==a&&(null==s||null==u))throw new Error("missing x");if(null==l&&(null==c||null==f))throw new Error("missing y");null!=t&&null!=o&&null!=i&&(void 0===a&&null!=s&&null!=u&&(a=function(t,n,e){return{transform(r){const o=r.length,i=new Float64Array(o),a=(n-t)/e,l=t+a/2;for(let t=0;tt),{x:a,y:l}=e,{document:s}=o,[c,u,f,h]=Yp(e,r,o),d=f-c,p=h-u,{pixelSize:m,width:y=Math.round(Math.abs(d)/m),height:g=Math.round(Math.abs(p)/m)}=this,v=y*g;let{fill:x,fillOpacity:w}=e,b=0;if(this.interpolate){const n=y/d,e=g/p,r=Do(a,(t=>(t-c)*n),Float64Array),o=Do(l,(t=>(t-u)*e),Float64Array);x&&(x=this.interpolate(t,y,g,r,o,x)),w&&(w=this.interpolate(t,y,g,r,o,w))}else null==this.data&&t&&(b=t.fi*v);const k=s.createElement("canvas");k.width=y,k.height=g;const $=k.getContext("2d"),M=$.createImageData(y,g),L=M.data;let{r:A,g:E,b:z}=Be(this.fill)??{r:0,g:0,b:0},O=255*(this.fillOpacity??1);for(let t=0;t0&&vr(M,this.blur),$.putImageData(M,0,0),Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,n).call((t=>t.append("image").attr("transform",`translate(${c},${u}) scale(${Math.sign(f-c)},${Math.sign(h-u)})`).attr("width",Math.abs(d)).attr("height",Math.abs(p)).attr("preserveAspectRatio","none").call(Vs,"image-rendering",this.imageRendering).call(_s,this).attr("xlink:href",k.toDataURL()))).node()}}function Vp(t,n,e){arguments.length<3&&(e=n,n=null);let{x:r,y:o,[t]:i,...a}=e;return void 0===r&&void 0===o&&function(t){if(!pi(t))return!1;for(const n of t)if(null!=n)return"object"==typeof n&&"0"in n&&"1"in n}(n)&&(r=Ao,o=Eo,void 0===i&&(i=zo)),[n,{...a,x:r,y:o,[t]:i}]}function Hp(){const[t,n]=Vp("fill",...arguments);return new Pp(t,null==t||void 0!==n.fill||void 0!==n.fillOpacity?n:{...n,fill:bo})}function Yp({x1:t,y1:n,x2:e,y2:r},o,{projection:i}){const{width:a,height:l,marginTop:s,marginRight:c,marginBottom:u,marginLeft:f}=o;return[t&&null==i?t[0]:f,n&&null==i?n[0]:s,e&&null==i?e[0]:a-c,r&&null==i?r[0]:l-u]}function Up({x1:t,y1:n,x2:e,y2:r},o,i,a){const l={};return t&&(l.x1=t),n&&(l.y1=n),e&&(l.x2=e),r&&(l.y2=r),Yp(Da(l,o),i,a)}function Xp(t,n={}){const{[t]:e}=n;if("function"!=typeof e)throw new Error(`invalid ${t}: not a function`);return Yi({...n,[t]:void 0},(function(r,o,i,a,l,s){const{x:c,y:u}=a;if(!c)throw new Error("missing scale: x");if(!u)throw new Error("missing scale: y");const[f,h,d,p]=Up(i,a,l,s),m=d-f,y=p-h,{pixelSize:g}=this,{width:v=Math.round(Math.abs(m)/g),height:x=Math.round(Math.abs(y)/g)}=n,w=new Array(v*x*(o?o.length:1)),b=m/v,k=y/x;let $=0;for(const t of o??[void 0])for(let n=.5;n=n||o[l]<0||o[l]>=e||(a[Math.floor(o[l])*n+Math.floor(r[l])]=i[l]);return a}function Zp({random:t=Z(42)}={}){return(n,e,r,o,i,a)=>{const{points:l,triangles:s,hull:c}=xr.from(n,(t=>o[t]),(t=>i[t])),u=new a.constructor(e*r).fill(NaN),f=new Uint8Array(e*r),h=function(t,n){return wi(t)||gi(t)?nm:function(t){return(n,e,r,o,i,a,l,s)=>{const c=t(l,s);return c=e||n<0||n>=r)continue;const o=t+.5,i=n+.5,a=((g-v)*(o-m)+(i-v)*(m-p))/$;if(a<0)continue;const l=((v-y)*(o-m)+(i-v)*(d-m))/$;if(l<0)continue;const s=1-a-l;if(s<0)continue;const c=t+e*n;u[c]=h(M,a,L,l,A,s,t,n),f[c]=1}}return function(t,n,e,r,o,i,a,l,s,c){e=Float64Array.from(l,(t=>e[s[t]])),r=Float64Array.from(l,(t=>r[s[t]])),o=Array.from(l,(t=>o[s[t]]));const u=e.length,f=Array.from({length:u},((t,n)=>function(t,n,e){const r=n.length,o=n.at(t-2),i=e.at(t-2),a=n.at(t-1),l=e.at(t-1),s=n[t],c=e[t],u=n.at(t+1-r),f=e.at(t+1-r),h=a-s,d=l-c,p=o-a,m=i-l,y=s-u,g=c-f,v=Math.hypot(h,d),x=Math.hypot(p,m),w=Math.hypot(y,g);return(t,n)=>{const e=t-a,r=n-l,o=t-s,i=n-c;return Kp(e,r,o,i)>-1e-6&&Kp(e,r,h,d)*x-Kp(e,r,p,m)*v>-1e-6&&Kp(o,i,y,g)*v-Kp(o,i,h,d)*w<=0}}(n,e,r)));let h=0;for(let l=0;l0&&c>0?s/(s+c):+(s>c)}function Kp(t,n,e,r){return t*r-e*n}function Qp(t,n,e,r,o,i){const a=new i.constructor(n*e),l=xr.from(t,(t=>r[t]),(t=>o[t]));let s,c;for(let r=.5,o=0;r{const c=new s.constructor(o*i),u=xr.from(r,(t=>a[t]),(t=>l[t]));let f,h,d;for(let p=.5,m=0;pn&&vt.map((t=>t.value)),label:ai(e)};for(const n in o)"value"===r[n]&&(r[n]=t)}if(null==t){if(null==e)throw new Error("missing contour value");r=Xp("value",{value:e,...r}),e=null}else{let{interpolate:t}=r;void 0===e&&(e=bo),void 0===t&&(r.interpolate="nearest")}super(t,{value:{value:e,optional:!0}},function({thresholds:t,interval:n,...e}){return t=vh(t,n,ir),Yi(e,(function(n,e,r,o,i,a){const[l,s,c,u]=Up(r,o,i,a),f=c-l,h=u-s,{pixelSize:d,width:p=Math.round(Math.abs(f)/d),height:m=Math.round(Math.abs(h)/d)}=this,y=p/f,g=m/h,v=r.value.value,x=[];if(this.interpolate){const{x:t,y:n}=hl(r,o,a),i=Do(t,(t=>(t-l)*y),Float64Array),c=Do(n,(t=>(t-s)*g),Float64Array),u=[r.x,r.y,r.value],f=[i,c,v];for(const t of e){const n=this.filter(t,u,f);x.push(this.interpolate(n,p,m,i,c,v))}}else if(e){const t=p*m,n=e.length;for(let e=0;e0)for(const t of x)wr({data:t,width:p,height:m},this.blur);const w=function(t,n,e,r){if("function"==typeof t?.range)return t.range(t.floor(e),r);"function"==typeof t&&(t=t(n,e,r));if("number"!=typeof t)return Fo(t);const o=se(...kr(e,r,t),t);for(;o[o.length-1]>=r;)o.pop();for(;o[1]ct(t,im))),N(t,(t=>N(t,im)))]}(x));if(null===w)throw new Error(`unsupported thresholds: ${t}`);const{contour:b}=br().size([p,m]).smooth(this.smooth),k=[],$=[];for(const t of x)$.push(I(k.length,k.push(...Do(w,(n=>b(t,n))))));for(const{coordinates:t}of k)for(const n of t)for(const t of n)for(const n of t)n[0]=n[0]/y+l,n[1]=n[1]/g+s;return{data:k,facets:$,channels:Fa(this.contourChannels,k)}}))}(r),em);const i={geometry:{value:bo}};for(const t in this.channels){const n=this.channels[t],{scale:e}=n;"x"!==e&&"y"!==e&&"value"!==t&&(i[t]=n,delete this.channels[t])}this.contourChannels=i,this.smooth=!!n}filter(t,{x:n,y:e,value:r,...o},i){return super.filter(t,o,i)}render(t,n,e,r,o){const{geometry:i}=e,a=mt();return Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,n).call((n=>{n.selectAll().data(t).enter().append("path").call(_s,this).attr("d",(t=>a(i[t]))).call(js,this,e)})).node()}}function om(){return new rm(...Vp("value",...arguments))}function im(t){return isFinite(t)?t:NaN}function am(t,n){return cm(wc,t,n)}function lm(t,n={}){return cm(bc,t,n)}function sm(t,n={}){return cm(kc,t,n)}function cm(t,n,e={}){const{x:r,y:o,maxRadius:i}=e,a=t({px:r,py:o,maxRadius:i}),l=[];null!=r&&l.push(Qc(n,hm("x",{...a,inset:-6},e))),null!=o&&l.push(tu(n,hm("y",{...a,inset:-6},e))),null!=r&&l.push(su(n,dm("x",{...a,dy:9,frameAnchor:"bottom",lineAnchor:"top"},e))),null!=o&&l.push(su(n,dm("y",{...a,dx:-9,frameAnchor:"left",textAnchor:"end"},e)));for(const t of l)t.ariaLabel=`crosshair ${t.ariaLabel}`;return pc(...l)}function um(t,{channels:n,...e},{facet:r,facetAnchor:o,fx:i,fy:a,[t]:l,channels:s,transform:c,initializer:u}){return{...e,facet:r,facetAnchor:o,fx:i,fy:a,[t]:l,channels:{...n,...s},transform:c,initializer:fm(t,u)}}function fm(t,n){return null==n?n:function(e,r,{x:o,y:i,px:a,py:l,...s},...c){const{channels:{x:u,y:f,...h}={},...d}=n.call(this,e,r,{...s,x:a,y:l},...c);return{channels:{...h,...u&&{px:u,..."x"===t&&{x:u}},...f&&{py:f,..."y"===t&&{y:f}}},...d}}}function hm(t,n,e){const{color:r="currentColor",opacity:o=.2,ruleStroke:i=r,ruleStrokeOpacity:a=o,ruleStrokeWidth:l}=e;return{...um(t,n,e),stroke:i,strokeOpacity:a,strokeWidth:l}}function dm(t,n,e){const{color:r="currentColor",textFill:o=r,textFillOpacity:i,textStroke:a="var(--plot-background)",textStrokeOpacity:l,textStrokeWidth:s=5}=e;return{...um(t,n,pm(t,e)),fill:o,fillOpacity:i,stroke:a,strokeOpacity:l,strokeWidth:s}}function pm(t,n){return Yi(n,((n,e,r)=>({channels:{text:{value:Ga(r,t)?.value}}})))}const mm={ariaLabel:"delaunay link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},ym={ariaLabel:"delaunay mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},gm={ariaLabel:"hull",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeMiterlimit:1},vm={ariaLabel:"voronoi",fill:"none",stroke:"currentColor",strokeMiterlimit:1},xm={ariaLabel:"voronoi mesh",fill:null,stroke:"currentColor",strokeOpacity:.2};class wm extends dc{constructor(t,n={}){const{x:e,y:r,z:o,curve:i,tension:a}=n;super(t,{x:{value:e,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},z:{value:o,optional:!0}},n,mm),this.curve=ih(i,a),Ec(this,n)}render(t,n,e,r,o){const{x:i,y:a}=n,{x:l,y:s,z:c}=e,{curve:u}=this,[f,h]=Js(this,r),d=l?t=>l[t]:Oo(f),p=s?t=>s[t]:Oo(h),m=this;function y(t){let n=-1;const r=[],i={};for(const t in e)i[t]=[];const a=[],l=[],s=[],c=[];function f(o,u){o=t[o],u=t[u],r.push(++n),a[n]=d(o),s[n]=p(o),l[n]=d(u),c[n]=p(u);for(const t in e)i[t].push(e[t][u])}const{halfedges:h,hull:y,triangles:g}=xr.from(t,d,p);for(let t=0;tt&&f(g[t],g[n])}for(let t=0;t{const n=je(),e=u(n);return e.lineStart(),e.point(a[t],s[t]),e.point(l[t],c[t]),e.lineEnd(),n})).call(js,m,i).call(Ic,m,i,o)}return Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,{x:l&&i,y:s&&a}).call(c?n=>n.selectAll().data(J(t,(t=>c[t])).values()).enter().append("g").each(y):n=>n.datum(t).each(y)).node()}}class bm extends dc{constructor(t,n={},e,r=(({z:t})=>t)){const{x:o,y:i}=n;super(t,{x:{value:o,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},z:{value:r(n),optional:!0}},n,e)}render(t,n,e,r,o){const{x:i,y:a}=n,{x:l,y:s,z:c}=e,[u,f]=Js(this,r),h=l?t=>l[t]:Oo(u),d=s?t=>s[t]:Oo(f),p=this;function m(t){const n=xr.from(t,h,d);ht(this).append("path").datum(t[0]).call(_s,p).attr("d",p._render(n,r)).call(js,p,e)}return Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,{x:l&&i,y:s&&a}).call(c?n=>n.selectAll().data(J(t,(t=>c[t])).values()).enter().append("g").each(m):n=>n.datum(t).each(m)).node()}}class km extends bm{constructor(t,n={}){super(t,n,ym),this.fill="none"}_render(t){return t.render()}}class $m extends bm{constructor(t,n={}){super(t,n,gm,Jo)}_render(t){return t.renderHull()}}class Mm extends dc{constructor(t,n={}){const{x:e,y:r,z:o}=n;super(t,{x:{value:e,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},z:{value:o,optional:!0}},n,vm)}render(t,n,e,r,o){const{x:i,y:a}=n,{x:l,y:s,z:c}=e,[u,f]=Js(this,r),h=l?t=>l[t]:Oo(u),d=s?t=>s[t]:Oo(f),p=this;function m(t){const n=Am(xr.from(t,h,d),r);ht(this).selectAll().data(t).enter().append("path").call(_s,p).attr("d",((t,e)=>n.renderCell(e))).call(js,p,e)}return Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,{x:l&&i,y:s&&a}).call(c?n=>n.selectAll().data(J(t,(t=>c[t])).values()).enter().append("g").each(m):n=>n.datum(t).each(m)).node()}}class Lm extends bm{constructor(t,n){super(t,n,xm),this.fill="none"}_render(t,n){return Am(t,n).render()}}function Am(t,n){const{width:e,height:r,marginTop:o,marginRight:i,marginBottom:a,marginLeft:l}=n;return t.voronoi([l,o,e-i,r-a])}function Em(t,n,{x:e,y:r,...o}={}){return[e,r]=Zo(e,r),new t(n,{...o,x:e,y:r})}function zm(t,n){return Em(wm,t,n)}function Om(t,n){return Em(km,t,n)}function Sm(t,n){return Em($m,t,n)}function Nm(t,n){return Em(Mm,t,n)}function Cm(t,n){return Em(Lm,t,n)}const Tm={ariaLabel:"density",fill:"none",stroke:"currentColor",strokeMiterlimit:1};class Rm extends dc{constructor(t,{x:n,y:e,z:r,weight:o,fill:i,stroke:a,...l}={}){const s=jm(i)&&(i="currentColor",!0),c=jm(a)&&(a="currentColor",!0);super(t,{x:{value:n,scale:"x",optional:!0},y:{value:e,scale:"y",optional:!0},z:{value:Jo({z:r,fill:i,stroke:a}),optional:!0},weight:{value:o,optional:!0}},function(t,n,e){const r=100;let{bandwidth:o,thresholds:i}=t;return o=void 0===o?20:+o,i=void 0===i?20:"function"==typeof i?.[Symbol.iterator]?No(i):+i,Yi(t,(function(t,a,l,s,c,u){const f=l.weight?No(l.weight.value):null,h=l.z?.value,{z:d}=this,[p,m]=Js(this,c),{width:y,height:g}=c,{x:v,y:x}=hl(l,s,u),w=Object.fromEntries(Object.entries(l).filter((([t])=>!Wm.has(t))).map((([t,n])=>[t,{...n,value:[]}]))),b=n&&[],k=e&&[],$=$r().x(v?t=>v[t]:p).y(x?t=>x[t]:m).weight(f?t=>f[t]:1).size([y,g]).bandwidth(o),M=[];for(const t of a){const n=[];M.push(n);for(const e of h?Fs(t,h,d):[t]){const t=$.contours(e);n.push([e,t])}}let L=i;if(!(L instanceof fo)){let t=0;for(const n of M)for(const[,e]of n){const n=e.max;n>t&&(t=n)}L=Float64Array.from({length:i-1},((n,e)=>t*r*(e+1)/i))}const A=[],E=[];for(const t of M){const n=[];A.push(n);for(const[e,o]of t)for(const t of L){n.push(E.length),E.push(o(t/r)),b&&b.push(t),k&&k.push(t);for(const t in w)w[t].value.push(l[t].value[e[0]])}}return b&&b.push(0),k&&k.push(0),{data:t,facets:A,channels:{...w,...b&&{fill:{value:b,scale:"color"}},...k&&{stroke:{value:k,scale:"color"}},contours:{value:E}}}}))}({...l,fill:i,stroke:a},s,c),Tm),s&&(this.fill=void 0),c&&(this.stroke=void 0),this.z=r}filter(t){return t}render(t,n,e,r,o){const{contours:i}=e,a=mt();return Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,{}).call((n=>n.selectAll().data(t).enter().append("path").call(_s,this).call(js,this,e).attr("d",(t=>a(i[t]))))).node()}}function Im(t,{x:n,y:e,...r}={}){return[n,e]=Zo(n,e),new Rm(t,{...r,x:n,y:e})}const Wm=new Set(["x","y","z","weight"]);function jm(t){return/^density$/i.test(t)}function Bm(t,{x1:n,x2:e,y1:r,y2:o,x:i=(void 0===n&&void 0===e?wo:void 0),y:a=(void 0===r&&void 0===o?bo:void 0),fill:l,positiveFill:s="#3ca951",negativeFill:c="#4269d0",fillOpacity:u=1,positiveFillOpacity:f=u,negativeFillOpacity:h=u,stroke:d,strokeOpacity:p,z:m=Io(d)[0],clip:y,tip:g,render:v,...x}={}){return[n,e]=Fm(i,n,e),[r,o]=Fm(a,r,o),n===e&&r===o&&(r=Dm(0)),({tip:g}=gc({tip:g},"x")),pc(Li(s)?null:Object.assign(id(t,{x1:n,x2:e,y1:r,y2:o,z:m,fill:s,fillOpacity:f,render:mc(v,qm(!0)),clip:y,...x}),{ariaLabel:"positive difference"}),Li(c)?null:Object.assign(id(t,{x1:n,x2:e,y1:r,y2:o,z:m,fill:c,fillOpacity:h,render:mc(v,qm(!1)),clip:y,...x}),{ariaLabel:"negative difference"}),jd(t,{x:e,y:o,z:m,stroke:d,strokeOpacity:p,tip:g,clip:!0,...x}))}function Fm(t,n,e){return void 0===n&&void 0===e?n=e=Dm(t):void 0===n?(e=Dm(e),n=void 0===t?e:Dm(t)):void 0===e?(n=Dm(n),e=void 0===t?n:Dm(t)):(n=Dm(n),e=Dm(e)),[n,e]}function Dm(t){let n;const{value:e,label:r=ai(e)}=di(t);return{transform:t=>n||(n=mo(t,e)),label:r}}function qm(t){return(n,e,r,o,i,a)=>{const{x1:l,x2:s}=r,{height:c}=o,u=new Float32Array(l.length),f=new Float32Array(s.length);(t===rs(e.y)<0?u:f).fill(c);const h=a(n,e,{...r,x2:l,y2:f},o,i),d=a(n,e,{...r,x1:s,y1:u},o,i),p=h.querySelector("g")??h,m=d.querySelector("g")??d;for(let t=0;p.firstChild;t+=2){const n=Ts(),e=Ja("svg:clipPath",i).attr("id",n).node();e.appendChild(p.firstChild),m.childNodes[t].setAttribute("clip-path",`url(#${n})`),m.insertBefore(e,m.childNodes[t])}return d}}const _m={ariaLabel:"geo",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class Pm extends dc{constructor(t,n={}){const[e,r]=Wo(n.r,3);super(t,{geometry:{value:n.geometry,scale:"projection"},r:{value:e,scale:"r",filter:Br,optional:!0}},zd(n),_m),this.r=r}render(t,n,e,r,o){const{geometry:i,r:a}=e,l=mt(o.projection??function({x:t,y:n}){if(t||n)return t??=t=>t,n??=t=>t,pt({point(e,r){this.stream.point(t(e),n(r))}})}(n)),{r:s}=this;return Fr(s)?t=[]:void 0!==s&&l.pointRadius(s),Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,n).call((n=>{n.selectAll().data(t).enter().append("path").call(_s,this).attr("d",a?t=>l.pointRadius(a[t])(i[t]):t=>l(i[t])).call(js,this,e)})).node()}}function Vm(t,{geometry:n=bo,...e}={}){switch(t?.type){case"FeatureCollection":t=t.features;break;case"GeometryCollection":t=t.geometries;break;case"Feature":case"LineString":case"MultiLineString":case"MultiPoint":case"MultiPolygon":case"Point":case"Polygon":case"Sphere":t=[t]}return new Pm(t,{geometry:n,...e})}function Hm({strokeWidth:t=1.5,...n}={}){return Vm({type:"Sphere"},{strokeWidth:t,...n})}function Ym({strokeOpacity:t=.1,...n}={}){return Vm(Mr(),{strokeOpacity:t,...n})}const Um=.5,Xm=0;function Gm(t={fill:"count"},{binWidth:n,...e}={}){const{z:r}=e;return n=void 0===n?20:Lo(n),ua(t=ga(t,e),"fill")&&(e.channels={...e.channels,fill:{value:[]}}),void 0===e.symbol&&(e.symbol="hexagon"),void 0!==e.r||ua(t,"r")||(e.r=n/2),Yi(e,((e,o,i,a,l,s)=>{let{x:c,y:u,z:f,fill:h,stroke:d,symbol:p}=i;if(void 0===c)throw new Error("missing channel: x");if(void 0===u)throw new Error("missing channel: y");({x:c,y:u}=hl(i,a,s)),f=f?f.value:mo(e,r),h=h?.value,d=d?.value,p=p?.value;const m=ka(t,{z:f,fill:h,stroke:d,symbol:p}),y=f&&[],g=h&&[],v=d&&[],x=p&&[],w=[],b=[],k=[];let $=-1;for(const n of t)n.initialize(e);for(const r of o){const o=[];for(const n of t)n.scope("facet",r);for(const[i,a]of pa(r,m))for(const{index:r,extent:l}of Zm(e,a,c,u,n)){o.push(++$),b.push(l.x),k.push(l.y),f&&y.push(m===f?i:f[r[0]]),h&&g.push(m===h?i:h[r[0]]),d&&v.push(m===d?i:d[r[0]]),p&&x.push(m===p?i:p[r[0]]);for(const n of t)n.reduce(r,l)}w.push(o)}const M=i.x.scale,L=i.y.scale;return{data:e,facets:w,channels:{x:{value:b,source:a[M]?{value:Do(b,a[M].invert),scale:M}:null},y:{value:k,source:a[L]?{value:Do(k,a[L].invert),scale:L}:null},...f&&{z:{value:y}},...h&&{fill:{value:g,scale:"auto"}},...d&&{stroke:{value:v,scale:"auto"}},...p&&{symbol:{value:x,scale:"auto"}},...Object.fromEntries(t.map((({name:t,output:e})=>[t,{scale:"auto",label:e.label,radius:"r"===t?n/2:void 0,value:e.transform()}])))}}}))}function Zm(t,n,e,r,o){const i=o*(1.5/Fi),a=new Map;for(const l of n){let n=e[l],s=r[l];if(isNaN(n)||isNaN(s))continue;let c=Math.round(s=(s-Xm)/i),u=Math.round(n=(n-Um)/o-(1&c)/2),f=s-c;if(3*Math.abs(f)>1){let t=n-u,e=u+(no*o+i*i&&(u=e+(1&c?1:-1)/2,c=r)}const h=`${u},${c}`;let d=a.get(h);void 0===d&&(d={index:[],extent:{data:t,x:(u+(1&c)/2)*o+Um,y:c*i+Xm}},a.set(h,d)),d.index.push(l)}return a.values()}const Jm={ariaLabel:"hexgrid",fill:"none",stroke:"currentColor",strokeOpacity:.1};function Km(t){return new Qm(t)}class Qm extends dc{constructor({binWidth:t=20,clip:n=!0,...e}={}){super(vo,void 0,{clip:n,...e},Jm),this.binWidth=Lo(t)}render(t,n,e,r,o){const{binWidth:i}=this,{marginTop:a,marginRight:l,marginBottom:s,marginLeft:c,width:u,height:f}=r,h=c-Um,d=u-l-Um,p=a-Xm,m=f-s-Xm,y=i/2,g=y*Di,v=g/2,x=2*y,w=1.5*g,b=Math.floor(h/x),k=Math.ceil(d/x),$=Math.floor((p+v)/w),M=Math.ceil((m-v)/w)+1,L=`m0,${ty(-g)}l${ty(y)},${ty(v)}v${ty(g)}l${ty(-y)},${ty(v)}`;let A=L;for(let t=$;tt.append("path").call(_s,this).call(js,this,e).attr("d",A))).node()}}function ty(t){return Math.round(1e3*t)/1e3}const ny={ariaLabel:"image",fill:null,stroke:null};class ey extends dc{constructor(t,n={}){let{x:e,y:r,r:o,width:i,height:a,rotate:l,src:s,preserveAspectRatio:c,crossOrigin:u,frameAnchor:f,imageRendering:h}=n;null==o&&(o=void 0),void 0===o&&void 0===i&&void 0===a?i=a=16:void 0===i&&void 0!==a?i=a:void 0===a&&void 0!==i&&(a=i);const[d,p]="string"==typeof(m=s)&&(function(t){return/^\.*\//.test(t)}(m)||function(t){return/^(blob|data|file|http|https):/i.test(t)}(m))?[void 0,m]:[m,void 0];var m;const[y,g]=Wo(o),[v,x]=Wo(i,void 0!==g?2*g:void 0),[w,b]=Wo(a,void 0!==g?2*g:void 0),[k,$]=Wo(l,0);super(t,{x:{value:e,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},r:{value:y,scale:"r",filter:Br,optional:!0},width:{value:v,filter:Br,optional:!0},height:{value:w,filter:Br,optional:!0},rotate:{value:k,optional:!0},src:{value:d,optional:!0}},zd(n),ny),this.src=p,this.width=x,this.rotate=$,this.height=b,this.r=g,this.preserveAspectRatio=Ys(c,"xMidYMid"),this.crossOrigin=Mo(u),this.frameAnchor=zi(f),this.imageRendering=Ys(h,"auto")}render(t,n,e,r,o){const{x:i,y:a}=n,{x:l,y:s,width:c,height:u,r:f,rotate:h,src:d}=e,{r:p,width:m,height:y,rotate:g}=this,[v,x]=Js(this,r);return Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,{x:l&&i,y:s&&a}).call((n=>n.selectAll().data(t).enter().append("image").call(_s,this).attr("x",ry(l,c,f,v,m,p)).attr("y",ry(s,u,f,x,y,p)).attr("width",c?t=>c[t]:void 0!==m?m:f?t=>2*f[t]:2*p).attr("height",u?t=>u[t]:void 0!==y?y:f?t=>2*f[t]:2*p).attr("transform",h?t=>`rotate(${h[t]})`:g?`rotate(${g})`:null).attr("transform-origin",h||g?eu`${l?t=>l[t]:v}px ${s?t=>s[t]:x}px`:null).call(Vs,"href",d?t=>d[t]:this.src).call(Vs,"preserveAspectRatio",this.preserveAspectRatio).call(Vs,"crossorigin",this.crossOrigin).call(Vs,"image-rendering",this.imageRendering).call(Vs,"clip-path",f?t=>`circle(${f[t]}px)`:void 0!==p?`circle(${p}px)`:null).call(js,this,e))).node()}}function ry(t,n,e,r,o,i){return n&&t?e=>t[e]-n[e]/2:n?t=>r-n[t]/2:t&&void 0!==o?n=>t[n]-o/2:void 0!==o?r-o/2:e&&t?n=>t[n]-e[n]:e?t=>r-e[t]:t?n=>t[n]-i:r-i}function oy(t,{x:n,y:e,...r}={}){return void 0===r.frameAnchor&&([n,e]=Zo(n,e)),new ey(t,{...r,x:n,y:e})}function iy(t,n,e){var r=0===t||1===t?0:Math.exp(ly(n+e)-ly(n)-ly(e)+n*Math.log(t)+e*Math.log(1-t));return!(t<0||t>1)&&(t<(n+1)/(n+e+2)?r*ay(t,n,e)/n:1-r*ay(1-t,e,n)/e)}function ay(t,n,e){var r,o,i,a,l=1e-30,s=1,c=n+e,u=n+1,f=n-1,h=1,d=1-c*t/u;for(Math.abs(d)=1)return 1;for(n>=1&&e>=1?(i=t<.5?t:1-t,s=(2.30753+.27061*(a=Math.sqrt(-2*Math.log(i))))/(1+a*(.99229+.04481*a))-a,t<.5&&(s=-s),c=(s*s-3)/6,u=2/(1/(2*n-1)+1/(2*e-1)),f=s*Math.sqrt(c+u)/u-(1/(2*e-1)-1/(2*n-1))*(c+5/6-2/(3*u)),s=n/(n+e*Math.exp(2*f))):(r=Math.log(n/(n+e)),o=Math.log(e/(n+e)),s=t<(a=Math.exp(n*r)/n)/(f=a+(l=Math.exp(e*o)/e))?Math.pow(n*f*t,1/n):1-Math.pow(e*f*(1-t),1/e)),h=-ly(n)-ly(e)+ly(n+e);m<10;m++){if(0===s||1===s)return s;if((s-=a=(l=(iy(s,n,e)-t)/(a=Math.exp(d*Math.log(s)+p*Math.log(1-s)+h)))/(1-.5*Math.min(1,l*(d/s-p/(1-s)))))<=0&&(s=.5*(s+a)),s>=1&&(s=.5*(s+a+1)),Math.abs(a)<1e-8*s&&m>0)break}return s}(2*Math.min(t,1-t),.5*n,.5);return e=Math.sqrt(n*(1-e)/e),t>.5?e:-e}const cy={ariaLabel:"linear-regression",fill:"currentColor",fillOpacity:.1,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class uy extends dc{constructor(t,n={}){const{x:e,y:r,z:o,ci:i=.95,precision:a=4}=n;if(super(t,{x:{value:e,scale:"x"},y:{value:r,scale:"y"},z:{value:Jo(n),optional:!0}},n,cy),this.z=o,this.ci=+i,this.precision=+a,!(0<=this.ci&&this.ci<1))throw new Error(`invalid ci; not in [0, 1): ${i}`);if(!(this.precision>0))throw new Error(`invalid precision: ${a}`)}render(t,n,e,r,o){const{x:i,y:a,z:l}=e,{ci:s}=this;return Ja("svg:g",o).call(qs,this,r,o).call(Hs,this,n).call((n=>n.selectAll().data(l?Fs(t,l,this.z):[t]).enter().call((t=>t.append("path").attr("fill","none").call(_s,this).call(Bs,this,{...e,fill:null,fillOpacity:null}).attr("d",(t=>this._renderLine(t,i,a))).call(s&&!Ai(this.fill)?t=>t.select(fy).attr("stroke","none").call(_s,this).call(Bs,this,{...e,stroke:null,strokeOpacity:null,strokeWidth:null}).attr("d",(t=>this._renderBand(t,i,a))):()=>{}))))).node()}}function fy(){return this.parentNode.insertBefore(this.ownerDocument.createElementNS(Ne.svg,"path"),this)}class hy extends uy{constructor(t,n){super(t,n)}_renderBand(t,n,e){const{ci:r,precision:o}=this,[i,a]=le(t,(t=>e[t])),l=yy(t,e,n),s=gy(t,e,n,(1-r)/2,l);return pr().y((t=>t)).x0((t=>s(t,-1))).x1((t=>s(t,1)))(I(i,a-o/2,o).concat(a))}_renderLine(t,n,e){const[r,o]=le(t,(t=>e[t])),i=yy(t,e,n);return`M${i(r)},${r}L${i(o)},${o}`}}class dy extends uy{constructor(t,n){super(t,n)}_renderBand(t,n,e){const{ci:r,precision:o}=this,[i,a]=le(t,(t=>n[t])),l=yy(t,n,e),s=gy(t,n,e,(1-r)/2,l);return pr().x((t=>t)).y0((t=>s(t,-1))).y1((t=>s(t,1)))(I(i,a-o/2,o).concat(a))}_renderLine(t,n,e){const[r,o]=le(t,(t=>n[t])),i=yy(t,n,e);return`M${r},${i(r)}L${o},${i(o)}`}}function py(t,{y:n=wo,x:e=bo,stroke:r,fill:o=(Li(r)?"currentColor":r),...i}={}){return new hy(t,dh({...i,x:e,y:n,fill:o,stroke:r}))}function my(t,{x:n=wo,y:e=bo,stroke:r,fill:o=(Li(r)?"currentColor":r),...i}={}){return new dy(t,hh({...i,x:n,y:e,fill:o,stroke:r}))}function yy(t,n,e){let r=0,o=0,i=0,a=0;for(const l of t){const t=n[l],s=e[l];r+=t,o+=s,i+=t*s,a+=t*t}const l=t.length,s=(l*i-r*o)/(l*a-r*r),c=(o-s*r)/l;return t=>s*t+c}function gy(t,n,e,r,o){const i=tt(t,(t=>n[t]))/t.length;let a=0,l=0;for(const r of t)a+=(n[r]-i)**2,l+=(e[r]-o(n[r]))**2;const s=Math.sqrt(l/(t.length-2)),c=sy(r,t.length-2);return(n,e)=>{const r=o(n),l=s*Math.sqrt(1/t.length+(n-i)**2/a);return r+e*c*l}}function vy({path:t=bo,delimiter:n,frameAnchor:e,treeLayout:r=Ar,treeSort:o,treeSeparation:i,treeAnchor:a,treeFilter:l,...s}={}){a=wy(a),o=$y(o),null!=l&&(l=Oy(l)),void 0===e&&(e=a.frameAnchor);const c=Ly(n),u=_y(s,Oy),[f,h]=oi(),[d,p]=oi();return{x:f,y:d,frameAnchor:e,...Hi(s,((n,e)=>{const s=c(mo(n,t)),f=h([]),d=p([]);let m=-1;const y=[],g=[],v=Lr().path((t=>s[t])),x=r();x.nodeSize&&x.nodeSize([1,1]),x.separation&&void 0!==i&&x.separation(i??ko);for(const t of u)t[qy]=t[Fy]([]);for(const t of e){const e=[],r=v(t.filter((t=>null!=s[t]))).each((t=>t.data=n[t.data]));null!=o&&r.sort(o),x(r);for(const t of r.descendants())if(null==l||l(t)){e.push(++m),y[m]=t.data,a.position(t,m,f,d);for(const n of u)n[qy][m]=n[Dy](t)}g.push(e)}return{data:y,facets:g}})),...Object.fromEntries(u)}}function xy({path:t=bo,delimiter:n,curve:e="bump-x",stroke:r="#555",strokeWidth:o=1.5,strokeOpacity:i=.5,treeLayout:a=Ar,treeSort:l,treeSeparation:s,treeAnchor:c,treeFilter:u,...f}={}){c=wy(c),l=$y(l),null!=u&&(u=Sy(u)),f={curve:e,stroke:r,strokeWidth:o,strokeOpacity:i,...f};const h=Ly(n),d=_y(f,Sy),[p,m]=oi(),[y,g]=oi(),[v,x]=oi(),[w,b]=oi();return{x1:p,x2:y,y1:v,y2:w,...Hi(f,((n,e)=>{const r=h(mo(n,t)),o=m([]),i=g([]),f=x([]),p=b([]);let y=-1;const v=[],w=[],k=Lr().path((t=>r[t])),$=a();$.nodeSize&&$.nodeSize([1,1]),$.separation&&void 0!==s&&$.separation(s??ko);for(const t of d)t[qy]=t[Fy]([]);for(const t of e){const e=[],a=k(t.filter((t=>null!=r[t]))).each((t=>t.data=n[t.data]));null!=l&&a.sort(l),$(a);for(const{source:t,target:n}of a.links())if(null==u||u(n,t)){e.push(++y),v[y]=n.data,c.position(t,y,o,f),c.position(n,y,i,p);for(const e of d)e[qy][y]=e[Dy](n,t)}w.push(e)}return{data:v,facets:w}})),...Object.fromEntries(d)}}function wy(t="left"){switch(`${t}`.trim().toLowerCase()){case"left":return by;case"right":return ky}throw new Error(`invalid tree anchor: ${t}`)}const by={frameAnchor:"left",dx:6,position({x:t,y:n},e,r,o){r[e]=n,o[e]=-t}},ky={frameAnchor:"right",dx:-6,position({x:t,y:n},e,r,o){r[e]=-n,o[e]=-t}};function $y(t){return null==t||"function"==typeof t?t:`${t}`.trim().toLowerCase().startsWith("node:")?My(Oy(t)):My(function(t){return n=>n.data?.[t]}(t))}function My(t){return(n,e)=>Rr(t(n),t(e))}function Ly(t="/"){if("/"===(t=`${t}`))return t=>t;if(1!==t.length)throw new Error("delimiter must be exactly one character");const n=t.charCodeAt(0);return t=>t.map((t=>function(t,n){if(n===Ay)throw new Error("delimiter cannot be backslash");let e=!1;for(let r=0,o=t.length;r0&&!By(t,n););return function(t){let n=!1;for(let e=0,r=t.length;enull==e?void 0:t(e)}function By(t,n){if("/"===t[n]){let e=0;for(;n>0&&"\\"===t[--n];)++e;if(0==(1&e))return!0}return!1}const Fy=2,Dy=3,qy=4;function _y(t,n){const e=[];for(const r in t){const o=t[r],i=n(o);void 0!==i&&e.push([r,...oi(o),i])}return e}function Py(t,{fill:n,stroke:e,strokeWidth:r,strokeOpacity:o,strokeLinejoin:i,strokeLinecap:a,strokeMiterlimit:l,strokeDasharray:s,strokeDashoffset:c,marker:u,markerStart:f=u,markerEnd:h=u,dot:d=Li(f)&&Li(h),text:p="node:name",textStroke:m="var(--plot-background)",title:y="node:path",dx:g,dy:v,textAnchor:x,treeLayout:w=Ar,textLayout:b=(w===Ar||w===Er?"mirrored":"normal"),tip:k,...$}={}){if(void 0===g&&(g=wy($.treeAnchor).dx),void 0!==x)throw new Error("textAnchor is not a configurable tree option");function M(e){return su(t,vy({treeLayout:w,text:p,fill:void 0===n?"currentColor":n,stroke:m,dx:g,dy:v,title:y,...e,...$}))}return b=Bo(b,"textLayout",["mirrored","normal"]),pc(ud(t,xy({treeLayout:w,markerStart:f,markerEnd:h,stroke:void 0!==e?e:void 0===n?"node:internal":n,strokeWidth:r,strokeOpacity:o,strokeLinejoin:i,strokeLinecap:a,strokeMiterlimit:l,strokeDasharray:s,strokeDashoffset:c,...$})),d?Sd(t,vy({treeLayout:w,fill:void 0===n?"node:internal":n,title:y,tip:k,...$})):null,null!=p?"mirrored"===b?[M({textAnchor:"start",treeFilter:"node:external"}),M({textAnchor:"end",treeFilter:"node:internal",dx:-g})]:M():null)}function Vy(t,n){return Py(t,{...n,treeLayout:Er})}function Hy({geometry:t=bo,...n}={}){return Yi({...n,x:null,y:null},((n,e,r,o,i,{projection:a})=>{const l=mo(n,t),s=l.length,c=new Float64Array(s),u=new Float64Array(s),f=mt(a);for(let t=0;tFloat64Array.from(e=mo(mo(n,t),zr),(([t])=>t))},y:{transform:()=>Float64Array.from(e,(([,t])=>t))}}}const Uy=({marginLeft:t})=>[1,t],Xy=({width:t,marginRight:n})=>[-1,t-n],Gy=({width:t,marginLeft:n,marginRight:e})=>[0,(n+t-e)/2],Zy=({marginTop:t})=>[1,t],Jy=({height:t,marginBottom:n})=>[-1,t-n],Ky=({height:t,marginTop:n,marginBottom:e})=>[0,(n+t-e)/2];function Qy(t){return"string"==typeof t?{anchor:t}:t}function tg(t={},n={}){1===arguments.length&&([t,n]=eg(t));let{anchor:e="left",padding:r=1,r:o=n.r}=Qy(t);switch(`${e}`.toLowerCase()){case"left":e=Uy;break;case"right":e=Xy;break;case"middle":e=Gy;break;default:throw new Error(`unknown dodge anchor: ${e}`)}return rg("x","y",e,Lo(r),o,n)}function ng(t={},n={}){1===arguments.length&&([t,n]=eg(t));let{anchor:e="bottom",padding:r=1,r:o=n.r}=Qy(t);switch(`${e}`.toLowerCase()){case"top":e=Zy;break;case"bottom":e=Jy;break;case"middle":e=Ky;break;default:throw new Error(`unknown dodge anchor: ${e}`)}return rg("y","x",e,Lo(r),o,n)}function eg(t){const{anchor:n,padding:e,...r}=t,{r:o}=r;return[{anchor:n,padding:e,r:o},r]}function rg(t,n,e,r,o,i){if(null!=o&&"number"!=typeof o){let{channels:t,sort:n,reverse:e}=i;t=Oi(t),void 0===t?.r&&(i={...i,channels:{...t,r:{value:o,scale:"r"}}}),void 0===n&&void 0===e&&(i.sort={channel:"-r"})}return Yi(i,(function(i,a,l,s,c,u){let{[n]:f,r:h}=l;if(!l[n])throw new Error(`missing channel: ${n}`);({[n]:f}=hl(l,s,u));const d=h?void 0:void 0!==o?Lo(o):void 0!==this.r?this.r:3;h&&(h=mo(h.value,s[h.scale]||bo,Float64Array));let[p,m]=e(c);const y=p?ig:og,g=new Float64Array(f.length),v=h?t=>h[t]:()=>d;for(let t of a){const n=Cr();t=t.filter(h?t=>jr(f[t])&&Br(h[t]):t=>jr(f[t]));const e=new Float64Array(2*t.length+2);for(const o of t){const t=v(o),i=p?t+r:0,a=f[o]-t,l=f[o]+t;let s=2;n.queryInterval(a-r,l+r,(([,,t])=>{const n=g[t]-i,a=f[o]-f[t],l=r+(h?h[o]+h[t]:2*d),c=Math.sqrt(l*l-a*a);e[s++]=n-c,e[s++]=n+c}));let c=e.slice(0,s);p&&(c=c.filter((t=>t>=0)));t:for(const t of c.sort(y)){for(let n=0;nt(n,(t=>e[t]))))}const fg={mapIndex(t,n,e){const[r,o]=le(t,(t=>n[t])),i=o-r;for(const o of t)e[o]=null===n[o]?NaN:(n[o]-r)/i}},hg=cg(((t,n)=>{for(let e=0;e{for(let e=t.length-1;e>=0;--e){const r=n[t[e]];if(Tr(r))return r}})),pg={mapIndex(t,n,e){const r=at(t,(t=>n[t])),o=ut(t,(t=>n[t]));for(const i of t)e[i]=null===n[i]?NaN:o?(n[i]-r)/o:0}},mg=ug(N),yg=ug(at),gg=ug(ot),vg=ug(ct),xg=ug(tt);function wg(t,n){return function(t,n,e={}){let r,o=1;if("number"==typeof n)o=n,r=(t,n)=>+t+n;else{if("string"==typeof n){const t=n.startsWith("-")?-1:1;[n,o]=ro(n.replace(/^[+-]/,"")),o*=t}n=ui(n),r=(t,e)=>n.offset(t,e)}const i=`${t}2`,a=rp({[`${t}1`]:t=>t.map((t=>r(t,o))),[i]:t=>t},e),l=a[i].transform;return a[i].transform=()=>{const t=l(),[n,e]=le(t);return t.domain=o<0?[n,r(e,o)]:[r(n,o),e],t},a}("x",t,n)}function bg(t,n={}){if("string"==typeof t)switch(t.toLowerCase()){case"first":return $g(n);case"last":return Mg(n)}if("function"==typeof t)return Tg(null,t,n);let e,r;for(e in t){if(void 0!==r)throw new Error("ambiguous selector; multiple inputs");r=kg(t[e])}if(void 0===r)throw new Error(`invalid selector: ${t}`);return Tg(e,r,n)}function kg(t){if("function"==typeof t)return t;switch(`${t}`.toLowerCase()){case"min":return Ng;case"max":return Cg}throw new Error(`unknown selector: ${t}`)}function $g(t){return Tg(null,Og,t)}function Mg(t){return Tg(null,Sg,t)}function Lg(t){return Tg("x",Ng,t)}function Ag(t){return Tg("y",Ng,t)}function Eg(t){return Tg("x",Cg,t)}function zg(t){return Tg("y",Cg,t)}function*Og(t){yield t[0]}function*Sg(t){yield t[t.length-1]}function*Ng(t,n){yield Or(t,(t=>n[t]))}function*Cg(t,n){yield dr(t,(t=>n[t]))}function Tg(t,n,e){if(null!=t){if(null==e[t])throw new Error(`missing channel: ${t}`);t=e[t]}const r=Jo(e);return Hi(e,((e,o)=>{const i=mo(e,r),a=mo(e,t),l=[];for(const t of o){const e=[];for(const r of i?J(t,(t=>i[t])).values():[t])for(const t of n(r,a))e.push(t);l.push(e)}return{data:e,facets:l}}))}export{od as Area,dd as Arrow,vd as BarX,xd as BarY,$d as Cell,rm as Contour,Rm as Density,Od as Dot,Ef as Frame,Pm as Geo,Qm as Hexgrid,ey as Image,Wd as Line,cd as Link,dc as Mark,Pp as Raster,qd as Rect,Jc as RuleX,Kc as RuleY,iu as Text,zp as TickX,Op as TickY,Nf as Tip,Ru as Vector,id as area,ad as areaX,ld as areaY,md as arrow,Yd as auto,Hd as autoSpec,Xu as axisFx,Yu as axisFy,Uu as axisX,Hu as axisY,wd as barX,bd as barY,uh as bin,sh as binX,ch as binY,Lp as bollinger,$p as bollingerX,Mp as bollingerY,Cp as boxX,Tp as boxY,Md as cell,Ld as cellX,Ad as cellY,Hy as centroid,Td as circle,Vy as cluster,oi as column,om as contour,am as crosshair,lm as crosshairX,sm as crosshairY,zm as delaunayLink,Om as delaunayMesh,Im as density,Bm as differenceY,tg as dodgeX,ng as dodgeY,Sd as dot,Nd as dotX,Cd as dotY,Zi as filter,ja as find,Os as formatIsoDate,Es as formatMonth,zs as formatWeekday,zf as frame,Vm as geo,Yy as geoCentroid,Ym as graticule,tf as gridFx,Ku as gridFy,Qu as gridX,Ju as gridY,sa as group,aa as groupX,la as groupY,ia as groupZ,Rd as hexagon,Gm as hexbin,Km as hexgrid,Sm as hull,bo as identity,oy as image,wo as indexOf,Yi as initializer,Qp as interpolateNearest,Gp as interpolateNone,Zp as interpolatorBarycentric,tm as interpolatorRandomWalk,bf as legend,jd as line,Bd as lineX,Fd as lineY,py as linearRegressionX,my as linearRegressionY,ud as link,rp as map,np as mapX,ep as mapY,pc as marks,sg as normalize,ag as normalizeX,lg as normalizeY,Df as plot,wc as pointer,bc as pointerX,kc as pointerY,Hp as raster,_d as rect,Pd as rectX,Vd as rectY,Ki as reverse,Qc as ruleX,tu as ruleY,bs as scale,bg as select,$g as selectFirst,Mg as selectLast,Eg as selectMaxX,zg as selectMaxY,Lg as selectMinX,Ag as selectMinY,wg as shiftX,ta as shuffle,na as sort,Hm as sphere,Bu as spike,Wh as stackX,jh as stackX1,Bh as stackX2,Fh as stackY,Dh as stackY1,qh as stackY2,su as text,cu as textX,uu as textY,Sp as tickX,Np as tickY,Cf as tip,Hi as transform,Py as tree,xy as treeLink,vy as treeNode,mo as valueof,Iu as vector,Wu as vectorX,ju as vectorY,Nm as voronoi,Cm as voronoiMesh,cp as window,lp as windowX,sp as windowY};export default null; diff --git a/_npm/binary-search-bounds@2.0.5/_esm.js b/_npm/binary-search-bounds@2.0.5/_esm.js new file mode 100644 index 0000000..4640119 --- /dev/null +++ b/_npm/binary-search-bounds@2.0.5/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/binary-search-bounds@2.0.5/search-bounds.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +function r(r,n,t,o,e){for(var u=e+1;o<=e;){var i=o+e>>>1,f=r[i];(void 0!==t?t(f,n):f-n)>=0?(u=i,e=i-1):o=i+1}return u}function n(r,n,t,o,e){for(var u=e+1;o<=e;){var i=o+e>>>1,f=r[i];(void 0!==t?t(f,n):f-n)>0?(u=i,e=i-1):o=i+1}return u}function t(r,n,t,o,e){for(var u=o-1;o<=e;){var i=o+e>>>1,f=r[i];(void 0!==t?t(f,n):f-n)<0?(u=i,o=i+1):e=i-1}return u}function o(r,n,t,o,e){for(var u=o-1;o<=e;){var i=o+e>>>1,f=r[i];(void 0!==t?t(f,n):f-n)<=0?(u=i,o=i+1):e=i-1}return u}function e(r,n,t,o,e){for(;o<=e;){var u=o+e>>>1,i=r[u],f=void 0!==t?t(i,n):i-n;if(0===f)return u;f<=0?o=u+1:e=u-1}return-1}function u(r,n,t,o,e,u){return"function"==typeof t?u(r,n,t,void 0===o?0:0|o,void 0===e?r.length-1:0|e):u(r,n,void 0,void 0===t?0:0|t,void 0===o?r.length-1:0|o)}var i={ge:function(n,t,o,e,i){return u(n,t,o,e,i,r)},gt:function(r,t,o,e,i){return u(r,t,o,e,i,n)},lt:function(r,n,o,e,i){return u(r,n,o,e,i,t)},le:function(r,n,t,e,i){return u(r,n,t,e,i,o)},eq:function(r,n,t,o,i){return u(r,n,t,o,i,e)}},f=i.eq,v=i.ge,a=i.gt,c=i.le,d=i.lt;export{i as default,f as eq,v as ge,a as gt,c as le,d as lt}; diff --git a/_npm/d3-axis@3.0.0/_esm.js b/_npm/d3-axis@3.0.0/_esm.js new file mode 100644 index 0000000..6e162f0 --- /dev/null +++ b/_npm/d3-axis@3.0.0/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/d3-axis@3.0.0/src/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +function t(t){return t}var n=1,r=2,e=3,i=4,a=1e-6;function o(t){return"translate("+t+",0)"}function u(t){return"translate(0,"+t+")"}function c(t){return n=>+t(n)}function l(t,n){return n=Math.max(0,t.bandwidth()-2*n)/2,t.round()&&(n=Math.round(n)),r=>+t(r)+n}function s(){return!this.__axis}function f(f,d){var m=[],h=null,g=null,p=6,k=6,x=3,y="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,A=f===n||f===i?-1:1,M=f===i||f===r?"x":"y",v=f===n||f===e?o:u;function w(o){var u=null==h?d.ticks?d.ticks.apply(d,m):d.domain():h,w=null==g?d.tickFormat?d.tickFormat.apply(d,m):t:g,_=Math.max(p,0)+x,F=d.range(),V=+F[0]+y,z=+F[F.length-1]+y,H=(d.bandwidth?l:c)(d.copy(),y),b=o.selection?o.selection():o,C=b.selectAll(".domain").data([null]),S=b.selectAll(".tick").data(u,d).order(),P=S.exit(),I=S.enter().append("g").attr("class","tick"),N=S.select("line"),O=S.select("text");C=C.merge(C.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),S=S.merge(I),N=N.merge(I.append("line").attr("stroke","currentColor").attr(M+"2",A*p)),O=O.merge(I.append("text").attr("fill","currentColor").attr(M,A*_).attr("dy",f===n?"0em":f===e?"0.71em":"0.32em")),o!==b&&(C=C.transition(o),S=S.transition(o),N=N.transition(o),O=O.transition(o),P=P.transition(o).attr("opacity",a).attr("transform",(function(t){return isFinite(t=H(t))?v(t+y):this.getAttribute("transform")})),I.attr("opacity",a).attr("transform",(function(t){var n=this.parentNode.__axis;return v((n&&isFinite(n=n(t))?n:H(t))+y)}))),P.remove(),C.attr("d",f===i||f===r?k?"M"+A*k+","+V+"H"+y+"V"+z+"H"+A*k:"M"+y+","+V+"V"+z:k?"M"+V+","+A*k+"V"+y+"H"+z+"V"+A*k:"M"+V+","+y+"H"+z),S.attr("opacity",1).attr("transform",(function(t){return v(H(t)+y)})),N.attr(M+"2",A*p),O.attr(M,A*_).text(w),b.filter(s).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",f===r?"start":f===i?"end":"middle"),b.each((function(){this.__axis=H}))}return w.scale=function(t){return arguments.length?(d=t,w):d},w.ticks=function(){return m=Array.from(arguments),w},w.tickArguments=function(t){return arguments.length?(m=null==t?[]:Array.from(t),w):m.slice()},w.tickValues=function(t){return arguments.length?(h=null==t?null:Array.from(t),w):h&&h.slice()},w.tickFormat=function(t){return arguments.length?(g=t,w):g},w.tickSize=function(t){return arguments.length?(p=k=+t,w):p},w.tickSizeInner=function(t){return arguments.length?(p=+t,w):p},w.tickSizeOuter=function(t){return arguments.length?(k=+t,w):k},w.tickPadding=function(t){return arguments.length?(x=+t,w):x},w.offset=function(t){return arguments.length?(y=+t,w):y},w}function d(t){return f(n,t)}function m(t){return f(r,t)}function h(t){return f(e,t)}function g(t){return f(i,t)}export{h as axisBottom,g as axisLeft,m as axisRight,d as axisTop};export default null; diff --git a/_npm/d3-brush@3.0.0/_esm.js b/_npm/d3-brush@3.0.0/_esm.js new file mode 100644 index 0000000..f8e2b36 --- /dev/null +++ b/_npm/d3-brush@3.0.0/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/d3-brush@3.0.0/src/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +import{dispatch as t}from"../d3-dispatch@3.0.1/_esm.js";import{dragDisable as e,dragEnable as n}from"../d3-drag@3.0.0/_esm.js";import{interpolate as r}from"../d3-interpolate@3.0.1/_esm.js";import{select as s,pointer as i}from"../d3-selection@3.0.0/_esm.js";import{interrupt as u}from"../d3-transition@3.0.1/_esm.js";var o=t=>()=>t;function a(t,{sourceEvent:e,target:n,selection:r,mode:s,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:s,enumerable:!0,configurable:!0},_:{value:i}})}function l(t){t.preventDefault(),t.stopImmediatePropagation()}var c={name:"drag"},h={name:"space"},f={name:"handle"},p={name:"center"};const{abs:m,max:d,min:v}=Math;function y(t){return[+t[0],+t[1]]}function b(t){return[y(t[0]),y(t[1])]}var w={name:"x",handles:["w","e"].map(K),input:function(t,e){return null==t?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},g={name:"y",handles:["n","s"].map(K),input:function(t,e){return null==t?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},_={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(K),input:function(t){return null==t?null:b(t)},output:function(t){return t}},x={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},k={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},z={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},A={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},E={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function K(t){return{type:t}}function P(t){return!t.ctrlKey&&!t.button}function T(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function V(){return navigator.maxTouchPoints||"ontouchstart"in this}function B(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function C(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function I(){return j(w)}function M(){return j(g)}function S(){return j(_)}function j(y){var _,C=T,I=P,M=V,S=!0,j=t("start","brush","end"),D=6;function G(t){var e=t.property("__brush",L).selectAll(".overlay").data([K("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",x.overlay).merge(e).each((function(){var t=B(this).extent;s(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),t.selectAll(".selection").data([K("selection")]).enter().append("rect").attr("class","selection").attr("cursor",x.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var n=t.selectAll(".handle").data(y.handles,(function(t){return t.type}));n.exit().remove(),n.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return x[t.type]})),t.each(N).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",F).filter(M).on("touchstart.brush",F).on("touchmove.brush",H).on("touchend.brush touchcancel.brush",J).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function N(){var t=s(this),e=B(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?e[1][0]-D/2:e[0][0]-D/2})).attr("y",(function(t){return"s"===t.type[0]?e[1][1]-D/2:e[0][1]-D/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+D:D})).attr("height",(function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+D:D}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function O(t,e,n){var r=t.__brush.emitter;return!r||n&&r.clean?new q(t,e,n):r}function q(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function F(t){if((!_||t.touches)&&I.apply(this,arguments)){var r,o,a,b,K,P,T,V,C,M,j,D=this,G=t.target.__data__.type,q="selection"===(S&&t.metaKey?G="overlay":G)?c:S&&t.altKey?p:f,F=y===g?null:A[G],H=y===w?null:E[G],J=B(D),L=J.extent,Q=J.selection,R=L[0][0],U=L[0][1],W=L[1][0],X=L[1][1],Y=0,Z=0,$=F&&H&&S&&t.shiftKey,tt=Array.from(t.touches||[t],(t=>{const e=t.identifier;return(t=i(t,D)).point0=t.slice(),t.identifier=e,t}));u(D);var et=O(D,arguments,!0).beforestart();if("overlay"===G){Q&&(C=!0);const e=[tt[0],tt[1]||tt[0]];J.selection=Q=[[r=y===g?R:v(e[0][0],e[1][0]),a=y===w?U:v(e[0][1],e[1][1])],[K=y===g?W:d(e[0][0],e[1][0]),T=y===w?X:d(e[0][1],e[1][1])]],tt.length>1&&ut(t)}else r=Q[0][0],a=Q[0][1],K=Q[1][0],T=Q[1][1];o=r,b=a,P=K,V=T;var nt=s(D).attr("pointer-events","none"),rt=nt.selectAll(".overlay").attr("cursor",x[G]);if(t.touches)et.moved=it,et.ended=ot;else{var st=s(t.view).on("mousemove.brush",it,!0).on("mouseup.brush",ot,!0);S&&st.on("keydown.brush",(function(t){switch(t.keyCode){case 16:$=F&&H;break;case 18:q===f&&(F&&(K=P-Y*F,r=o+Y*F),H&&(T=V-Z*H,a=b+Z*H),q=p,ut(t));break;case 32:q!==f&&q!==p||(F<0?K=P-Y:F>0&&(r=o-Y),H<0?T=V-Z:H>0&&(a=b-Z),q=h,rt.attr("cursor",x.selection),ut(t));break;default:return}l(t)}),!0).on("keyup.brush",(function(t){switch(t.keyCode){case 16:$&&(M=j=$=!1,ut(t));break;case 18:q===p&&(F<0?K=P:F>0&&(r=o),H<0?T=V:H>0&&(a=b),q=f,ut(t));break;case 32:q===h&&(t.altKey?(F&&(K=P-Y*F,r=o+Y*F),H&&(T=V-Z*H,a=b+Z*H),q=p):(F<0?K=P:F>0&&(r=o),H<0?T=V:H>0&&(a=b),q=f),rt.attr("cursor",x[G]),ut(t));break;default:return}l(t)}),!0),e(t.view)}N.call(D),et.start(t,q.name)}function it(t){for(const e of t.changedTouches||[t])for(const t of tt)t.identifier===e.identifier&&(t.cur=i(e,D));if($&&!M&&!j&&1===tt.length){const t=tt[0];m(t.cur[0]-t[0])>m(t.cur[1]-t[1])?j=!0:M=!0}for(const t of tt)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);C=!0,l(t),ut(t)}function ut(t){const e=tt[0],n=e.point0;var s;switch(Y=e[0]-n[0],Z=e[1]-n[1],q){case h:case c:F&&(Y=d(R-r,v(W-K,Y)),o=r+Y,P=K+Y),H&&(Z=d(U-a,v(X-T,Z)),b=a+Z,V=T+Z);break;case f:tt[1]?(F&&(o=d(R,v(W,tt[0][0])),P=d(R,v(W,tt[1][0])),F=1),H&&(b=d(U,v(X,tt[0][1])),V=d(U,v(X,tt[1][1])),H=1)):(F<0?(Y=d(R-r,v(W-r,Y)),o=r+Y,P=K):F>0&&(Y=d(R-K,v(W-K,Y)),o=r,P=K+Y),H<0?(Z=d(U-a,v(X-a,Z)),b=a+Z,V=T):H>0&&(Z=d(U-T,v(X-T,Z)),b=a,V=T+Z));break;case p:F&&(o=d(R,v(W,r-Y*F)),P=d(R,v(W,K+Y*F))),H&&(b=d(U,v(X,a-Z*H)),V=d(U,v(X,T+Z*H)))}Pn+e))}function f(){return p(!1,!1)}function s(){return p(!1,!0)}function g(){return p(!0,!1)}function p(n,t){var e=0,r=null,u=null,l=null;function i(i){var f,s=i.length,g=new Array(s),p=c(0,s),h=new Array(s*s),d=new Array(s),v=0;i=Float64Array.from({length:s*s},t?(n,t)=>i[t%s][t/s|0]:(n,t)=>i[t/s|0][t%s]);for(let t=0;tr(g[n],g[t])));for(const e of p){const r=t;if(n){const n=c(1+~s,s).filter((n=>n<0?i[~n*s+e]:i[e*s+n]));u&&n.sort(((n,t)=>u(n<0?-i[~n*s+e]:i[e*s+n],t<0?-i[~t*s+e]:i[e*s+t])));for(const r of n)if(r<0){(h[~r*s+e]||(h[~r*s+e]={source:null,target:null})).target={index:e,startAngle:t,endAngle:t+=i[~r*s+e]*v,value:i[~r*s+e]}}else{(h[e*s+r]||(h[e*s+r]={source:null,target:null})).source={index:e,startAngle:t,endAngle:t+=i[e*s+r]*v,value:i[e*s+r]}}d[e]={index:e,startAngle:r,endAngle:t,value:g[e]}}else{const n=c(0,s).filter((n=>i[e*s+n]||i[n*s+e]));u&&n.sort(((n,t)=>u(i[e*s+n],i[e*s+t])));for(const r of n){let n;if(ei&&(t(M-T)>2*A+i?M>T?(T+=A,M-=A):(T-=A,M+=A):T=M=(T+M)/2,t(w-q)>2*A+i?w>q?(q+=A,w-=A):(q-=A,w+=A):q=w=(q+w)/2),b.moveTo(m*e(T),m*r(T)),b.arc(0,0,m,T,M),T!==q||M!==w)if(u){var R=C-+u.apply(this,arguments),P=(q+w)/2;b.quadraticCurveTo(0,0,R*e(q),R*r(q)),b.lineTo(C*e(P),C*r(P)),b.lineTo(R*e(w),R*r(w))}else b.quadraticCurveTo(0,0,C*e(q),C*r(q)),b.arc(0,0,C,q,w);if(b.quadraticCurveTo(0,0,m*e(T),m*r(T)),b.closePath(),d)return b=null,d+""||null}return u&&(M.headRadius=function(n){return arguments.length?(u="function"==typeof n?n:d(+n),M):u}),M.radius=function(n){return arguments.length?(c=f="function"==typeof n?n:d(+n),M):c},M.sourceRadius=function(n){return arguments.length?(c="function"==typeof n?n:d(+n),M):c},M.targetRadius=function(n){return arguments.length?(f="function"==typeof n?n:d(+n),M):f},M.startAngle=function(n){return arguments.length?(s="function"==typeof n?n:d(+n),M):s},M.endAngle=function(n){return arguments.length?(g="function"==typeof n?n:d(+n),M):g},M.padAngle=function(n){return arguments.length?(p="function"==typeof n?n:d(+n),M):p},M.source=function(n){return arguments.length?(o=n,M):o},M.target=function(n){return arguments.length?(a=n,M):a},M.context=function(n){return arguments.length?(b=null==n?null:n,M):b},M}function C(){return M()}function q(){return M(b)}export{f as chord,g as chordDirected,s as chordTranspose,C as ribbon,q as ribbonArrow};export default null; diff --git a/_npm/d3-contour@4.0.2/_esm.js b/_npm/d3-contour@4.0.2/_esm.js new file mode 100644 index 0000000..ebc4d39 --- /dev/null +++ b/_npm/d3-contour@4.0.2/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/d3-contour@4.0.2/src/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +import{thresholdSturges as r,extent as n,ticks as t,nice as o,blur2 as e,max as i}from"../d3-array@3.2.4/_esm.js";var u=Array.prototype.slice;function a(r,n){return r-n}var f=r=>()=>r;function c(r,n){for(var t,o=-1,e=n.length;++oo!=g>o&&t<(d-c)*(o-h)/(g-h)+c&&(e=-e)}return e}function s(r,n,t){var o,e,i,u;return function(r,n,t){return(n[0]-r[0])*(t[1]-r[1])==(t[0]-r[0])*(n[1]-r[1])}(r,n,t)&&(e=r[o=+(r[0]===n[0])],i=t[o],u=n[o],e<=i&&i<=u||u<=i&&i<=e)}function l(){}var d=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function g(){var e=1,i=1,h=r,s=A;function g(r){var e=h(r);if(Array.isArray(e))e=e.slice().sort(a);else{const i=n(r,v);for(e=t(...o(i[0],i[1],e),e);e[e.length-1]>=i[1];)e.pop();for(;e[1]E(r,n)))}function E(r,n){const t=null==n?NaN:+n;if(isNaN(t))throw new Error(`invalid value: ${n}`);var o=[],u=[];return function(r,n,t){var o,u,a,f,c,h,s=new Array,l=new Array;o=u=-1,f=p(r[0],n),d[f<<1].forEach(g);for(;++o=n,d[c<<2].forEach(g);for(;++o0?o.push([n]):u.push(n)})),u.forEach((function(r){for(var n,t=0,e=o.length;t0&&o0&&u=0&&t>=0))throw new Error("invalid size");return e=n,i=t,g},g.thresholds=function(r){return arguments.length?(h="function"==typeof r?r:Array.isArray(r)?f(u.call(r)):f(r),g):h},g.smooth=function(r){return arguments.length?(s=r?A:l,g):s===A},g}function v(r){return isFinite(r)?r:NaN}function p(r,n){return null!=r&&+r>=n}function y(r){return null==r||isNaN(r=+r)?-1/0:r}function w(r,n,t,o){const e=o-n,i=t-n,u=isFinite(e)||isFinite(i)?e/i:Math.sign(e)/Math.sign(i);return isNaN(u)?r:r+u-.5}function E(r){return r[0]}function M(r){return r[1]}function A(){return 1}function N(){var r=E,n=M,o=A,a=960,c=500,h=20,s=2,l=3*h,d=a+2*l>>s,v=c+2*l>>s,p=f(20);function y(t){var i=new Float32Array(d*v),u=Math.pow(2,-s),a=-1;for(const e of t){var f=(r(e,++a,t)+l)*u,c=(n(e,a,t)+l)*u,g=+o(e,a,t);if(g&&f>=0&&f=0&&cr*e)))(n).map(((r,n)=>(r.value=+o[n],N(r))))}function N(r){return r.coordinates.forEach(m),r}function m(r){r.forEach(z)}function z(r){r.forEach(b)}function b(r){r[0]=r[0]*Math.pow(2,s)-l,r[1]=r[1]*Math.pow(2,s)-l}function x(){return d=a+2*(l=3*h)>>s,v=c+2*l>>s,w}return w.contours=function(r){var n=y(r),t=g().size([d,v]),o=Math.pow(2,2*s),e=r=>{r=+r;var e=N(t.contour(n,r*o));return e.value=r,e};return Object.defineProperty(e,"max",{get:()=>i(n)/o}),e},w.x=function(n){return arguments.length?(r="function"==typeof n?n:f(+n),w):r},w.y=function(r){return arguments.length?(n="function"==typeof r?r:f(+r),w):n},w.weight=function(r){return arguments.length?(o="function"==typeof r?r:f(+r),w):o},w.size=function(r){if(!arguments.length)return[a,c];var n=+r[0],t=+r[1];if(!(n>=0&&t>=0))throw new Error("invalid size");return a=n,c=t,x()},w.cellSize=function(r){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return s=Math.floor(Math.log(r)/Math.LN2),x()},w.thresholds=function(r){return arguments.length?(p="function"==typeof r?r:Array.isArray(r)?f(u.call(r)):f(r),w):p},w.bandwidth=function(r){if(!arguments.length)return Math.sqrt(h*(h+1));if(!((r=+r)>=0))throw new Error("invalid bandwidth");return h=(Math.sqrt(4*r*r+1)-1)/2,x()},w}export{N as contourDensity,g as contours};export default null; diff --git a/_npm/d3-delaunay@6.0.4/_esm.js b/_npm/d3-delaunay@6.0.4/_esm.js new file mode 100644 index 0000000..02cdbef --- /dev/null +++ b/_npm/d3-delaunay@6.0.4/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/d3-delaunay@6.0.4/src/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +import t from"../delaunator@5.0.1/_esm.js";const e=1e-6;class i{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,i,n){const s=(t=+t)+(n=+n),l=i=+i;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${s},${l}`:(Math.abs(this._x1-s)>e||Math.abs(this._y1-l)>e)&&(this._+="L"+s+","+l),n&&(this._+=`A${n},${n},0,1,1,${t-n},${i}A${n},${n},0,1,1,${this._x1=s},${this._y1=l}`)}rect(t,e,i,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+i}v${+n}h${-i}Z`}value(){return this._||null}}class n{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class s{constructor(t,[e,i,n,s]=[0,0,960,500]){if(!((n=+n)>=(e=+e)&&(s=+s)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=n,this.xmin=e,this.ymax=s,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:i},vectors:n}=this;let s,l;const h=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let n,r,o=0,a=0,c=i.length;o1;)l-=2;for(let t=2;t0){if(e>=this.ymax)return null;(s=(this.ymax-e)/n)0){if(t>=this.xmax)return null;(s=(this.xmax-t)/i)this.xmax?2:0)|(ethis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let e=0;e2&&function(t){const{triangles:e,coords:i}=t;for(let t=0;t1e-10)return!1}return!0}(e)){this.collinear=Int32Array.from({length:i.length/2},((t,e)=>e)).sort(((t,e)=>i[2*t]-i[2*e]||i[2*t+1]-i[2*e+1]));const e=this.collinear[0],n=this.collinear[this.collinear.length-1],s=[i[2*e],i[2*e+1],i[2*n],i[2*n+1]],l=1e-8*Math.hypot(s[3]-s[1],s[2]-s[0]);for(let t=0,e=i.length/2;t0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=s[0],h[s[0]]=1,2===s.length&&(h[s[1]]=0,this.triangles[1]=s[1],this.triangles[2]=s[1]))}voronoi(t){return new s(this,t)}*neighbors(t){const{inedges:e,hull:i,_hullIndex:n,halfedges:s,triangles:l,collinear:h}=this;if(h){const e=h.indexOf(t);return e>0&&(yield h[e-1]),void(e=0&&s!==i&&s!==n;)i=s;return s}_step(t,e,i){const{inedges:n,hull:s,_hullIndex:l,halfedges:r,triangles:o,points:a}=this;if(-1===n[t]||!a.length)return(t+1)%(a.length>>1);let c=t,u=h(e-a[2*t],2)+h(i-a[2*t+1],2);const g=n[t];let d=g;do{let n=o[d];const g=h(e-a[2*n],2)+h(i-a[2*n+1],2);if(g{}};function r(){for(var n,r=0,e=arguments.length,o={};r=0&&(r=n.slice(t+1),n=n.slice(0,t)),n&&!i.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}}))),f=-1,u=a.length;if(!(arguments.length<2)){if(null!=r&&"function"!=typeof r)throw new Error("invalid callback: "+r);for(;++f0)for(var t,e,o=new Array(t),i=0;i()=>e;function s(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:a,x:i,y:u,dx:c,dy:l,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:s}})}function f(e){return!e.ctrlKey&&!e.button}function d(){return this.parentNode}function g(e,t){return null==t?{x:e.x,y:e.y}:t}function h(){return navigator.maxTouchPoints||"ontouchstart"in this}function m(){var m,v,p,b,y=f,x=d,_=g,w=h,E={},T=e("start","drag","end"),j=0,k=0;function M(e){e.on("mousedown.drag",P).filter(w).on("touchstart.drag",S).on("touchmove.drag",U,r).on("touchend.drag touchcancel.drag",I).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function P(e,n){if(!b&&y.call(this,e,n)){var r=X(this,x.call(this,e,n),e,n,"mouse");r&&(t(e.view).on("mousemove.drag",z,o).on("mouseup.drag",D,o),u(e.view),a(e),p=!1,m=e.clientX,v=e.clientY,r("start",e))}}function z(e){if(i(e),!p){var t=e.clientX-m,n=e.clientY-v;p=t*t+n*n>k}E.mouse("drag",e)}function D(e){t(e.view).on("mousemove.drag mouseup.drag",null),c(e.view,p),i(e),E.mouse("end",e)}function S(e,t){if(y.call(this,e,t)){var n,r,o=e.changedTouches,i=x.call(this,e,t),u=o.length;for(n=0;n9999?"+"+o(n,6):o(n,4))+"-"+o(r.getUTCMonth()+1,2)+"-"+o(r.getUTCDate(),2)+(u?"T"+o(t,2)+":"+o(e,2)+":"+o(a,2)+"."+o(u,3)+"Z":a?"T"+o(t,2)+":"+o(e,2)+":"+o(a,2)+"Z":e||t?"T"+o(t,2)+":"+o(e,2)+"Z":"")}function u(o){var u=new RegExp('["'+o+"\n\r]"),i=o.charCodeAt(0);function f(t,e){var o,a=[],u=t.length,f=0,c=0,s=u<=0,l=!1;function d(){if(s)return n;if(l)return l=!1,r;var e,o,a=f;if(34===t.charCodeAt(a)){for(;f++=u?s=!0:10===(o=t.charCodeAt(f++))?l=!0:13===o&&(l=!0,10===t.charCodeAt(f)&&++f),t.slice(a+1,e-1).replace(/""/g,'"')}for(;f+n;function t(n){return n*n}function e(n){return n*(2-n)}function a(n){return((n*=2)<=1?n*n:--n*(2-n)+1)/2}function u(n){return n*n*n}function r(n){return--n*n*n+1}function s(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var o=function n(t){function e(n){return Math.pow(n,t)}return t=+t,e.exponent=n,e}(3),i=function n(t){function e(n){return 1-Math.pow(1-n,t)}return t=+t,e.exponent=n,e}(3),c=function n(t){function e(n){return((n*=2)<=1?Math.pow(n,t):2-Math.pow(2-n,t))/2}return t=+t,e.exponent=n,e}(3),f=Math.PI,h=f/2;function M(n){return 1==+n?1:1-Math.cos(n*h)}function p(n){return Math.sin(n*h)}function I(n){return(1-Math.cos(f*n))/2}function l(n){return 1.0009775171065494*(Math.pow(2,-10*n)-.0009765625)}function O(n){return l(1-+n)}function x(n){return 1-l(n)}function d(n){return((n*=2)<=1?l(1-n):2-l(n-1))/2}function v(n){return 1-Math.sqrt(1-n*n)}function B(n){return Math.sqrt(1- --n*n)}function C(n){return((n*=2)<=1?1-Math.sqrt(1-n*n):Math.sqrt(1-(n-=2)*n)+1)/2}var E=4/11,m=6/11,P=8/11,w=3/4,b=9/11,k=10/11,q=15/16,y=21/22,Q=63/64,S=1/E/E;function L(n){return 1-g(1-n)}function g(n){return(n=+n)s(n,r).then((n=>(new DOMParser).parseFromString(n,t)))}var v=x("application/xml"),d=x("text/html"),g=x("image/svg+xml");export{o as blob,f as buffer,h as csv,c as dsv,d as html,m as image,p as json,g as svg,s as text,l as tsv,v as xml};export default null; diff --git a/_npm/d3-force@3.0.0/_esm.js b/_npm/d3-force@3.0.0/_esm.js new file mode 100644 index 0000000..9c56263 --- /dev/null +++ b/_npm/d3-force@3.0.0/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/d3-force@3.0.0/src/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +import{quadtree as n}from"../d3-quadtree@3.0.1/_esm.js";import{dispatch as t}from"../d3-dispatch@3.0.1/_esm.js";import{timer as r}from"../d3-timer@3.0.1/_esm.js";function e(n,t){var r,e=1;function i(){var i,o,u=r.length,f=0,a=0;for(i=0;iy+l||ex+l||ih.index){var v=y-u.x-u.vx,d=x-u.y-u.vy,p=v*v+d*d;pn.r&&(n.r=n[t].r)}function y(){if(r){var n,i,o=r.length;for(e=new Array(o),n=0;n[h(n,t,e),n])));for(i=0,u=new Array(a);i(n=(v*n+y)%x)/x}();function s(){p(),h.call("tick",e),i1?(null==t?c.delete(n):c.set(n,w(t)),e):c.get(n)},find:function(t,r,e){var i,o,u,f,a,c=0,l=n.length;for(null==e?e=1/0:e*=e,c=0;c1?(h.on(n,t),e):h.on(n)}}}function M(){var t,r,e,u,f,a=i(-30),c=1,l=1/0,h=.81;function v(e){var i,o=t.length,f=n(t,g,s).visitAfter(x);for(u=e,i=0;i=l)){(n.data!==r||n.next)&&(0===v&&(g+=(v=o(e))*v),0===y&&(g+=(y=o(e))*y),g0?1:n<0?-1:0},w=Math.sqrt,x=Math.tan;function _(n){return n>1?0:n<-1?o:Math.acos(n)}function N(n){return n>1?u:n<-1?-u:Math.asin(n)}function R(n){return(n=m(n/2))*n}function C(){}function P(n,t){n&&$.hasOwnProperty(n.type)&&$[n.type](n,t)}var A={Feature:function(n,t){P(n.geometry,t)},FeatureCollection:function(n,t){for(var r=n.features,i=-1,e=r.length;++i=0?1:-1,e=i*r,o=g(t=(t*=f)/2+a),u=m(t),c=T*u,l=O*o+c*g(e),s=c*i*m(e);J.add(h(s,l)),G=n,O=o,T=u}function en(t){return K=new n,j(t,Q),2*K}function on(n){return[h(n[1],n[0]),N(n[2])]}function un(n){var t=n[0],r=n[1],i=g(r);return[i*g(t),i*m(t),m(r)]}function an(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function cn(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function ln(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function fn(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function sn(n){var t=w(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var pn,hn,gn,vn,dn,En,yn,Sn,mn,Mn,wn,xn,_n,Nn,Rn,Cn,Pn={point:An,lineStart:qn,lineEnd:zn,polygonStart:function(){Pn.point=jn,Pn.lineStart=Ln,Pn.lineEnd=bn,D=new n,Q.polygonStart()},polygonEnd:function(){Q.polygonEnd(),Pn.point=An,Pn.lineStart=qn,Pn.lineEnd=zn,J<0?(k=-(H=180),F=-(I=90)):D>i?I=90:D<-i&&(F=-90),Z[0]=k,Z[1]=H},sphere:function(){k=-(H=180),F=-(I=90)}};function An(n,t){U.push(Z=[k=n,H=n]),tI&&(I=t)}function $n(n,t){var r=un([n*f,t*f]);if(B){var i=cn(B,r),e=cn([i[1],-i[0],0],i);sn(e),e=on(e);var o,u=n-W,a=u>0?1:-1,c=e[0]*l*a,p=s(u)>180;p^(a*WI&&(I=o):p^(a*W<(c=(c+360)%360-180)&&cI&&(I=t)),p?nGn(k,H)&&(H=n):Gn(n,H)>Gn(k,H)&&(k=n):H>=k?(nH&&(H=n)):n>W?Gn(k,n)>Gn(k,H)&&(H=n):Gn(n,H)>Gn(k,H)&&(k=n)}else U.push(Z=[k=n,H=n]);tI&&(I=t),B=r,W=n}function qn(){Pn.point=$n}function zn(){Z[0]=k,Z[1]=H,Pn.point=An,B=null}function jn(n,t){if(B){var r=n-W;D.add(s(r)>180?r+(r>0?360:-360):r)}else X=n,Y=t;Q.point(n,t),$n(n,t)}function Ln(){Q.lineStart()}function bn(){jn(X,Y),Q.lineEnd(),s(D)>i&&(k=-(H=180)),Z[0]=k,Z[1]=H,B=null}function Gn(n,t){return(t-=n)<0?t+360:t}function On(n,t){return n[0]-t[0]}function Tn(n,t){return n[0]<=n[1]?n[0]<=t&&t<=n[1]:tGn(i[0],i[1])&&(i[1]=e[1]),Gn(e[0],i[1])>Gn(i[0],i[1])&&(i[0]=e[0])):o.push(i=e);for(u=-1/0,t=0,i=o[r=o.length-1];t<=r;i=e,++t)e=o[t],(a=Gn(i[1],e[0]))>u&&(u=a,k=e[0],H=i[1])}return U=Z=null,k===1/0||F===1/0?[[NaN,NaN],[NaN,NaN]]:[[k,F],[H,I]]}var Fn={sphere:C,point:Hn,lineStart:Wn,lineEnd:Bn,polygonStart:function(){Fn.lineStart=Dn,Fn.lineEnd=Un},polygonEnd:function(){Fn.lineStart=Wn,Fn.lineEnd=Bn}};function Hn(n,t){n*=f;var r=g(t*=f);In(r*g(n),r*m(n),m(t))}function In(n,t,r){++pn,gn+=(n-gn)/pn,vn+=(t-vn)/pn,dn+=(r-dn)/pn}function Wn(){Fn.point=Xn}function Xn(n,t){n*=f;var r=g(t*=f);Nn=r*g(n),Rn=r*m(n),Cn=m(t),Fn.point=Yn,In(Nn,Rn,Cn)}function Yn(n,t){n*=f;var r=g(t*=f),i=r*g(n),e=r*m(n),o=m(t),u=h(w((u=Rn*o-Cn*e)*u+(u=Cn*i-Nn*o)*u+(u=Nn*e-Rn*i)*u),Nn*i+Rn*e+Cn*o);hn+=u,En+=u*(Nn+(Nn=i)),yn+=u*(Rn+(Rn=e)),Sn+=u*(Cn+(Cn=o)),In(Nn,Rn,Cn)}function Bn(){Fn.point=Hn}function Dn(){Fn.point=Zn}function Un(){Jn(xn,_n),Fn.point=Hn}function Zn(n,t){xn=n,_n=t,n*=f,t*=f,Fn.point=Jn;var r=g(t);Nn=r*g(n),Rn=r*m(n),Cn=m(t),In(Nn,Rn,Cn)}function Jn(n,t){n*=f;var r=g(t*=f),i=r*g(n),e=r*m(n),o=m(t),u=Rn*o-Cn*e,a=Cn*i-Nn*o,c=Nn*e-Rn*i,l=E(u,a,c),s=N(l),p=l&&-s/l;mn.add(p*u),Mn.add(p*a),wn.add(p*c),hn+=s,En+=s*(Nn+(Nn=i)),yn+=s*(Rn+(Rn=e)),Sn+=s*(Cn+(Cn=o)),In(Nn,Rn,Cn)}function Kn(t){pn=hn=gn=vn=dn=En=yn=Sn=0,mn=new n,Mn=new n,wn=new n,j(t,Fn);var r=+mn,o=+Mn,u=+wn,a=E(r,o,u);return ao&&(n-=Math.round(n/c)*c),[n,t]}function tt(n,t,r){return(n%=c)?t||r?Vn(it(n),et(t,r)):it(n):t||r?et(t,r):nt}function rt(n){return function(t,r){return s(t+=n)>o&&(t-=Math.round(t/c)*c),[t,r]}}function it(n){var t=rt(n);return t.invert=rt(-n),t}function et(n,t){var r=g(n),i=m(n),e=g(t),o=m(t);function u(n,t){var u=g(t),a=g(n)*u,c=m(n)*u,l=m(t),f=l*r+a*i;return[h(c*e-f*o,a*r-l*i),N(f*e+c*o)]}return u.invert=function(n,t){var u=g(t),a=g(n)*u,c=m(n)*u,l=m(t),f=l*e-c*o;return[h(c*e+l*o,a*r+f*i),N(f*r-a*i)]},u}function ot(n){function t(t){return(t=n(t[0]*f,t[1]*f))[0]*=l,t[1]*=l,t}return n=tt(n[0]*f,n[1]*f,n.length>2?n[2]*f:0),t.invert=function(t){return(t=n.invert(t[0]*f,t[1]*f))[0]*=l,t[1]*=l,t},t}function ut(n,t,r,i,e,o){if(r){var u=g(t),a=m(t),l=i*r;null==e?(e=t+i*c,o=t-l/2):(e=at(u,e),o=at(u,o),(i>0?eo)&&(e+=i*c));for(var f,s=e;i>0?s>o:s1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],n=null,r}}}function ft(n,t){return s(n[0]-t[0])=0;--u)o.point((s=f[u])[0],s[1]);else e(h.x,h.p.x,-1,o);h=h.p}f=(h=h.o).z,g=!g}while(!h.v);o.lineEnd()}}}function ht(n){if(t=n.length){for(var t,r,i=0,e=n[0];++i=0?1:-1,O=G*b,T=O>o,k=C*j;if(E.add(h(k*G*m(O),P*L+k*g(O))),v+=T?b+G*c:b,T^_>=l^q>=l){var F=cn(un(x),un($));sn(F);var H=cn(p,F);sn(H);var I=(T^b>=0?-1:1)*N(H[2]);(f>I||f===I&&(F[0]||F[1]))&&(d+=T^b>=0?1:-1)}}return(v<-i||v0){for(p||(o.polygonStart(),p=!0),o.lineStart(),n=0;n1&&2&e&&l.push(l.pop().concat(l.shift())),a.push(l.filter(Et))}return h}}function Et(n){return n.length>1}function yt(n,t){return((n=n.x)[0]<0?n[1]-u-i:u-n[1])-((t=t.x)[0]<0?t[1]-u-i:u-t[1])}nt.invert=nt;var St=dt((function(){return!0}),(function(n){var t,r=NaN,e=NaN,a=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(c,l){var f=c>0?o:-o,h=s(c-r);s(h-o)0?u:-u),n.point(a,e),n.lineEnd(),n.lineStart(),n.point(f,e),n.point(c,e),t=0):a!==f&&h>=o&&(s(r-a)i?p((m(t)*(u=g(e))*m(r)-m(e)*(o=g(t))*m(n))/(o*u*a)):(t+e)/2}(r,e,c,l),n.point(a,e),n.lineEnd(),n.lineStart(),n.point(f,e),t=0),n.point(r=c,e=l),a=f},lineEnd:function(){n.lineEnd(),r=e=NaN},clean:function(){return 2-t}}}),(function(n,t,r,e){var a;if(null==n)a=r*u,e.point(-o,a),e.point(0,a),e.point(o,a),e.point(o,0),e.point(o,-a),e.point(0,-a),e.point(-o,-a),e.point(-o,0),e.point(-o,a);else if(s(n[0]-t[0])>i){var c=n[0]0,u=s(t)>i;function a(n,r){return g(n)*g(r)>t}function c(n,r,e){var u=[1,0,0],a=cn(un(n),un(r)),c=an(a,a),l=a[0],f=c-l*l;if(!f)return!e&&n;var p=t*c/f,h=-t*l/f,g=cn(u,a),v=fn(u,p);ln(v,fn(a,h));var d=g,E=an(v,d),y=an(d,d),S=E*E-y*(an(v,v)-1);if(!(S<0)){var m=w(S),M=fn(d,(-E-m)/y);if(ln(M,v),M=on(M),!e)return M;var x,_=n[0],N=r[0],R=n[1],C=r[1];N<_&&(x=_,_=N,N=x);var P=N-_,A=s(P-o)0^M[1]<(s(M[0]-_)o^(_<=M[0]&&M[0]<=N)){var $=fn(d,(-E+m)/y);return ln($,v),[M,on($)]}}}function l(t,r){var i=e?n:o-n,u=0;return t<-i?u|=1:t>i&&(u|=2),r<-i?u|=4:r>i&&(u|=8),u}return dt(a,(function(n){var t,r,i,f,s;return{lineStart:function(){f=i=!1,s=1},point:function(p,h){var g,v=[p,h],d=a(p,h),E=e?d?0:l(p,h):d?l(p+(p<0?o:-o),h):0;if(!t&&(f=i=d)&&n.lineStart(),d!==i&&(!(g=c(t,v))||ft(t,g)||ft(v,g))&&(v[2]=1),d!==i)s=0,d?(n.lineStart(),g=c(v,t),n.point(g[0],g[1])):(g=c(t,v),n.point(g[0],g[1],2),n.lineEnd()),t=g;else if(u&&t&&e^d){var y;E&r||!(y=c(v,t,!0))||(s=0,e?(n.lineStart(),n.point(y[0][0],y[0][1]),n.point(y[1][0],y[1][1]),n.lineEnd()):(n.point(y[1][0],y[1][1]),n.lineEnd(),n.lineStart(),n.point(y[0][0],y[0][1],3)))}!d||t&&ft(t,v)||n.point(v[0],v[1]),t=v,i=d,r=E},lineEnd:function(){i&&n.lineEnd(),t=null},clean:function(){return s|(f&&i)<<1}}}),(function(t,i,e,o){ut(o,n,r,e,t,i)}),e?[0,-n]:[-o,n-o])}var Mt,wt,xt,_t,Nt=1e9,Rt=-Nt;function Ct(n,r,e,o){function u(t,i){return n<=t&&t<=e&&r<=i&&i<=o}function a(t,i,u,a){var l=0,s=0;if(null==t||(l=c(t,u))!==(s=c(i,u))||f(t,i)<0^u>0)do{a.point(0===l||3===l?n:e,l>1?o:r)}while((l=(l+u+4)%4)!==s);else a.point(i[0],i[1])}function c(t,o){return s(t[0]-n)0?0:3:s(t[0]-e)0?2:1:s(t[1]-r)0?1:0:o>0?3:2}function l(n,t){return f(n.x,t.x)}function f(n,t){var r=c(n,1),i=c(t,1);return r!==i?r-i:0===r?t[1]-n[1]:1===r?n[0]-t[0]:2===r?n[1]-t[1]:t[0]-n[0]}return function(i){var c,f,s,p,h,g,v,d,E,y,S,m=i,M=lt(),w={point:x,lineStart:function(){w.point=_,f&&f.push(s=[]);y=!0,E=!1,v=d=NaN},lineEnd:function(){c&&(_(p,h),g&&E&&M.rejoin(),c.push(M.result()));w.point=x,E&&m.lineEnd()},polygonStart:function(){m=M,c=[],f=[],S=!0},polygonEnd:function(){var r=function(){for(var t=0,r=0,i=f.length;ro&&(p-e)*(o-u)>(h-u)*(n-e)&&++t:h<=o&&(p-e)*(o-u)<(h-u)*(n-e)&&--t;return t}(),e=S&&r,u=(c=t(c)).length;(e||u)&&(i.polygonStart(),e&&(i.lineStart(),a(null,null,1,i),i.lineEnd()),u&&pt(c,l,r,a,i),i.polygonEnd());m=i,c=f=s=null}};function x(n,t){u(n,t)&&m.point(n,t)}function _(t,i){var a=u(t,i);if(f&&s.push([t,i]),y)p=t,h=i,g=a,y=!1,a&&(m.lineStart(),m.point(t,i));else if(a&&E)m.point(t,i);else{var c=[v=Math.max(Rt,Math.min(Nt,v)),d=Math.max(Rt,Math.min(Nt,d))],l=[t=Math.max(Rt,Math.min(Nt,t)),i=Math.max(Rt,Math.min(Nt,i))];!function(n,t,r,i,e,o){var u,a=n[0],c=n[1],l=0,f=1,s=t[0]-a,p=t[1]-c;if(u=r-a,s||!(u>0)){if(u/=s,s<0){if(u0){if(u>f)return;u>l&&(l=u)}if(u=e-a,s||!(u<0)){if(u/=s,s<0){if(u>f)return;u>l&&(l=u)}else if(s>0){if(u0)){if(u/=p,p<0){if(u0){if(u>f)return;u>l&&(l=u)}if(u=o-c,p||!(u<0)){if(u/=p,p<0){if(u>f)return;u>l&&(l=u)}else if(p>0){if(u0&&(n[0]=a+l*s,n[1]=c+l*p),f<1&&(t[0]=a+f*s,t[1]=c+f*p),!0}}}}}(c,l,n,r,e,o)?a&&(m.lineStart(),m.point(t,i),S=!1):(E||(m.lineStart(),m.point(c[0],c[1])),m.point(l[0],l[1]),a||m.lineEnd(),S=!1)}v=t,d=i,E=a}return w}}function Pt(){var n,t,r,i=0,e=0,o=960,u=500;return r={stream:function(r){return n&&t===r?n:n=Ct(i,e,o,u)(t=r)},extent:function(a){return arguments.length?(i=+a[0][0],e=+a[0][1],o=+a[1][0],u=+a[1][1],n=t=null,r):[[i,e],[o,u]]}}}var At={sphere:C,point:C,lineStart:function(){At.point=qt,At.lineEnd=$t},lineEnd:C,polygonStart:C,polygonEnd:C};function $t(){At.point=At.lineEnd=C}function qt(n,t){wt=n*=f,xt=m(t*=f),_t=g(t),At.point=zt}function zt(n,t){n*=f;var r=m(t*=f),i=g(t),e=s(n-wt),o=g(e),u=i*m(e),a=_t*r-xt*i*o,c=xt*r+_t*i*o;Mt.add(h(w(u*u+a*a),c)),wt=n,xt=r,_t=i}function jt(t){return Mt=new n,j(t,At),+Mt}var Lt=[null,null],bt={type:"LineString",coordinates:Lt};function Gt(n,t){return Lt[0]=n,Lt[1]=t,jt(bt)}var Ot={Feature:function(n,t){return kt(n.geometry,t)},FeatureCollection:function(n,t){for(var r=n.features,i=-1,e=r.length;++i0&&(o=Gt(n[u],n[u-1]))>0&&r<=o&&i<=o&&(r+i-o)*(1-Math.pow((r-i)/o,2))i})).map(f)).concat(r(v(a/E)*E,u,E).filter((function(n){return s(n%S)>i})).map(p))}return M.lines=function(){return w().map((function(n){return{type:"LineString",coordinates:n}}))},M.outline=function(){return{type:"Polygon",coordinates:[h(o).concat(g(c).slice(1),h(e).reverse().slice(1),g(l).reverse().slice(1))]}},M.extent=function(n){return arguments.length?M.extentMajor(n).extentMinor(n):M.extentMinor()},M.extentMajor=function(n){return arguments.length?(o=+n[0][0],e=+n[1][0],l=+n[0][1],c=+n[1][1],o>e&&(n=o,o=e,e=n),l>c&&(n=l,l=c,c=n),M.precision(m)):[[o,l],[e,c]]},M.extentMinor=function(r){return arguments.length?(t=+r[0][0],n=+r[1][0],a=+r[0][1],u=+r[1][1],t>n&&(r=t,t=n,n=r),a>u&&(r=a,a=u,u=r),M.precision(m)):[[t,a],[n,u]]},M.step=function(n){return arguments.length?M.stepMajor(n).stepMinor(n):M.stepMinor()},M.stepMajor=function(n){return arguments.length?(y=+n[0],S=+n[1],M):[y,S]},M.stepMinor=function(n){return arguments.length?(d=+n[0],E=+n[1],M):[d,E]},M.precision=function(r){return arguments.length?(m=+r,f=Bt(a,u,90),p=Dt(t,n,m),h=Bt(l,c,90),g=Dt(o,e,m),M):m},M.extentMajor([[-180,-90+i],[180,90-i]]).extentMinor([[-180,-80-i],[180,80+i]])}function Zt(){return Ut()()}function Jt(n,t){var r=n[0]*f,i=n[1]*f,e=t[0]*f,o=t[1]*f,u=g(i),a=m(i),c=g(o),s=m(o),p=u*g(r),v=u*m(r),d=c*g(e),E=c*m(e),y=2*N(w(R(o-i)+u*c*R(e-r))),S=m(y),M=y?function(n){var t=m(n*=y)/S,r=m(y-n)/S,i=r*p+t*d,e=r*v+t*E,o=r*a+t*s;return[h(e,i)*l,h(o,w(i*i+e*e))*l]}:function(){return[r*l,i*l]};return M.distance=y,M}var Kt,Qt,Vt,nr,tr=n=>n,rr=new n,ir=new n,er={point:C,lineStart:C,lineEnd:C,polygonStart:function(){er.lineStart=or,er.lineEnd=cr},polygonEnd:function(){er.lineStart=er.lineEnd=er.point=C,rr.add(s(ir)),ir=new n},result:function(){var t=rr/2;return rr=new n,t}};function or(){er.point=ur}function ur(n,t){er.point=ar,Kt=Vt=n,Qt=nr=t}function ar(n,t){ir.add(nr*n-Vt*t),Vt=n,nr=t}function cr(){ar(Kt,Qt)}var lr=1/0,fr=lr,sr=-lr,pr=sr,hr={point:function(n,t){nsr&&(sr=n);tpr&&(pr=t)},lineStart:C,lineEnd:C,polygonStart:C,polygonEnd:C,result:function(){var n=[[lr,fr],[sr,pr]];return sr=pr=-(fr=lr=1/0),n}};var gr,vr,dr,Er,yr=0,Sr=0,mr=0,Mr=0,wr=0,xr=0,_r=0,Nr=0,Rr=0,Cr={point:Pr,lineStart:Ar,lineEnd:zr,polygonStart:function(){Cr.lineStart=jr,Cr.lineEnd=Lr},polygonEnd:function(){Cr.point=Pr,Cr.lineStart=Ar,Cr.lineEnd=zr},result:function(){var n=Rr?[_r/Rr,Nr/Rr]:xr?[Mr/xr,wr/xr]:mr?[yr/mr,Sr/mr]:[NaN,NaN];return yr=Sr=mr=Mr=wr=xr=_r=Nr=Rr=0,n}};function Pr(n,t){yr+=n,Sr+=t,++mr}function Ar(){Cr.point=$r}function $r(n,t){Cr.point=qr,Pr(dr=n,Er=t)}function qr(n,t){var r=n-dr,i=t-Er,e=w(r*r+i*i);Mr+=e*(dr+n)/2,wr+=e*(Er+t)/2,xr+=e,Pr(dr=n,Er=t)}function zr(){Cr.point=Pr}function jr(){Cr.point=br}function Lr(){Gr(gr,vr)}function br(n,t){Cr.point=Gr,Pr(gr=dr=n,vr=Er=t)}function Gr(n,t){var r=n-dr,i=t-Er,e=w(r*r+i*i);Mr+=e*(dr+n)/2,wr+=e*(Er+t)/2,xr+=e,_r+=(e=Er*n-dr*t)*(dr+n),Nr+=e*(Er+t),Rr+=3*e,Pr(dr=n,Er=t)}function Or(n){this._context=n}Or.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:this._context.moveTo(n,t),this._point=1;break;case 1:this._context.lineTo(n,t);break;default:this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,c)}},result:C};var Tr,kr,Fr,Hr,Ir,Wr=new n,Xr={point:C,lineStart:function(){Xr.point=Yr},lineEnd:function(){Tr&&Br(kr,Fr),Xr.point=C},polygonStart:function(){Tr=!0},polygonEnd:function(){Tr=null},result:function(){var t=+Wr;return Wr=new n,t}};function Yr(n,t){Xr.point=Br,kr=Hr=n,Fr=Ir=t}function Br(n,t){Hr-=n,Ir-=t,Wr.add(w(Hr*Hr+Ir*Ir)),Hr=n,Ir=t}let Dr,Ur,Zr,Jr;class Kr{constructor(n){this._append=null==n?Qr:function(n){const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);if(t>15)return Qr;if(t!==Dr){const n=10**t;Dr=t,Ur=function(t){let r=1;this._+=t[0];for(const i=t.length;r=0))throw new RangeError(`invalid digits: ${n}`);e=t}return null===t&&(i=new Kr(e)),u},u.projection(n).digits(e).context(t)}function ni(n){return{stream:ti(n)}}function ti(n){return function(t){var r=new ri;for(var i in n)r[i]=n[i];return r.stream=t,r}}function ri(){}function ii(n,t,r){var i=n.clipExtent&&n.clipExtent();return n.scale(150).translate([0,0]),null!=i&&n.clipExtent(null),j(r,n.stream(hr)),t(hr.result()),null!=i&&n.clipExtent(i),n}function ei(n,t,r){return ii(n,(function(r){var i=t[1][0]-t[0][0],e=t[1][1]-t[0][1],o=Math.min(i/(r[1][0]-r[0][0]),e/(r[1][1]-r[0][1])),u=+t[0][0]+(i-o*(r[1][0]+r[0][0]))/2,a=+t[0][1]+(e-o*(r[1][1]+r[0][1]))/2;n.scale(150*o).translate([u,a])}),r)}function oi(n,t,r){return ei(n,[[0,0],t],r)}function ui(n,t,r){return ii(n,(function(r){var i=+t,e=i/(r[1][0]-r[0][0]),o=(i-e*(r[1][0]+r[0][0]))/2,u=-e*r[0][1];n.scale(150*e).translate([o,u])}),r)}function ai(n,t,r){return ii(n,(function(r){var i=+t,e=i/(r[1][1]-r[0][1]),o=-e*r[0][0],u=(i-e*(r[1][1]+r[0][1]))/2;n.scale(150*e).translate([o,u])}),r)}ri.prototype={constructor:ri,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var ci=16,li=g(30*f);function fi(n,t){return+t?function(n,t){function r(e,o,u,a,c,l,f,p,g,v,d,E,y,S){var m=f-e,M=p-o,x=m*m+M*M;if(x>4*t&&y--){var _=a+v,R=c+d,C=l+E,P=w(_*_+R*R+C*C),A=N(C/=P),$=s(s(C)-1)t||s((m*L+M*b)/x-.5)>.3||a*v+c*d+l*E2?n[2]%360*f:0,z()):[y*l,S*l,m*l]},$.angle=function(n){return arguments.length?(M=n%360*f,z()):M*l},$.reflectX=function(n){return arguments.length?(x=n?-1:1,z()):x<0},$.reflectY=function(n){return arguments.length?(_=n?-1:1,z()):_<0},$.precision=function(n){return arguments.length?(u=fi(a,A=n*n),j()):w(A)},$.fitExtent=function(n,t){return ei($,n,t)},$.fitSize=function(n,t){return oi($,n,t)},$.fitWidth=function(n,t){return ui($,n,t)},$.fitHeight=function(n,t){return ai($,n,t)},function(){return t=n.apply(this,arguments),$.invert=t.invert&&q,z()}}function vi(n){var t=0,r=o/3,i=gi(n),e=i(t,r);return e.parallels=function(n){return arguments.length?i(t=n[0]*f,r=n[1]*f):[t*l,r*l]},e}function di(n,t){var r=m(n),e=(r+m(t))/2;if(s(e)=.12&&e<.234&&i>=-.425&&i<-.214?c:e>=.166&&e<.234&&i>=-.214&&i<-.115?l:a).invert(n)},s.stream=function(r){return n&&t===r?n:(i=[a.stream(t=r),c.stream(r),l.stream(r)],e=i.length,n={point:function(n,t){for(var r=-1;++r0?t<-u+i&&(t=-u+i):t>u-i&&(t=u-i);var r=a/S(Ai(t),e);return[r*m(e*n),a-r*g(e*n)]}return c.invert=function(n,t){var r=a-t,i=M(e)*w(n*n+r*r),c=h(n,s(r))*M(r);return r*e<0&&(c-=o*M(n)*M(r)),[c/e,2*p(S(a/i,1/e))-u]},c}function qi(){return vi($i).scale(109.5).parallels([30,30])}function zi(n,t){return[n,t]}function ji(){return hi(zi).scale(152.63)}function Li(n,t){var r=g(n),e=n===t?m(n):(r-g(t))/(t-n),u=r/e+n;if(s(e)2?n[2]+90:90]):[(n=r())[0],n[1],n[2]-90]},r([0,0,90]).scale(159.155)}Hi.invert=function(n,t){for(var r,i=t,o=i*i,u=o*o*o,a=0;a<12&&(u=(o=(i-=r=(i*(Gi+Oi*o+u*(Ti+ki*o))-t)/(Gi+3*Oi*o+u*(7*Ti+9*ki*o)))*i)*o*o,!(s(r)i&&--o>0);return[n/(.8707+(u=e*e)*(u*(u*u*u*(.003971-.001529*u)-.013791)-.131979)),e]},Ui.invert=Mi(N),Ji.invert=Mi((function(n){return 2*p(n)})),Qi.invert=function(n,t){return[-t,2*p(d(n))-u]};export{yi as geoAlbers,Si as geoAlbersUsa,en as geoArea,xi as geoAzimuthalEqualArea,wi as geoAzimuthalEqualAreaRaw,Ni as geoAzimuthalEquidistant,_i as geoAzimuthalEquidistantRaw,kn as geoBounds,Kn as geoCentroid,ct as geoCircle,St as geoClipAntimeridian,mt as geoClipCircle,Pt as geoClipExtent,Ct as geoClipRectangle,qi as geoConicConformal,$i as geoConicConformalRaw,Ei as geoConicEqualArea,di as geoConicEqualAreaRaw,bi as geoConicEquidistant,Li as geoConicEquidistantRaw,Yt as geoContains,Gt as geoDistance,Ii as geoEqualEarth,Hi as geoEqualEarthRaw,ji as geoEquirectangular,zi as geoEquirectangularRaw,Xi as geoGnomonic,Wi as geoGnomonicRaw,Ut as geoGraticule,Zt as geoGraticule10,Yi as geoIdentity,Jt as geoInterpolate,jt as geoLength,Ci as geoMercator,Ri as geoMercatorRaw,Di as geoNaturalEarth1,Bi as geoNaturalEarth1Raw,Zi as geoOrthographic,Ui as geoOrthographicRaw,Vr as geoPath,hi as geoProjection,gi as geoProjectionMutator,ot as geoRotation,Ki as geoStereographic,Ji as geoStereographicRaw,j as geoStream,ni as geoTransform,Vi as geoTransverseMercator,Qi as geoTransverseMercatorRaw};export default null; diff --git a/_npm/d3-hierarchy@3.1.2/_esm.js b/_npm/d3-hierarchy@3.1.2/_esm.js new file mode 100644 index 0000000..f1bb33b --- /dev/null +++ b/_npm/d3-hierarchy@3.1.2/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/d3-hierarchy@3.1.2/src/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +function n(n,r){return n.parent===r.parent?1:2}function r(n,r){return n+r.x}function t(n,r){return Math.max(n,r.y)}function e(){var e=n,u=1,i=1,o=!1;function a(n){var a,f=0;n.eachAfter((function(n){var u=n.children;u?(n.x=function(n){return n.reduce(r,0)/n.length}(u),n.y=function(n){return 1+n.reduce(t,0)}(u)):(n.x=a?f+=e(n,a):0,n.y=0,a=n)}));var c=function(n){for(var r;r=n.children;)n=r[0];return n}(n),h=function(n){for(var r;r=n.children;)n=r[r.length-1];return n}(n),l=c.x-e(c,h)/2,p=h.x+e(h,c)/2;return n.eachAfter(o?function(r){r.x=(r.x-n.x)*u,r.y=(n.y-r.y)*i}:function(r){r.x=(r.x-l)/(p-l)*u,r.y=(1-(n.y?r.y/n.y:1))*i})}return a.separation=function(n){return arguments.length?(e=n,a):e},a.size=function(n){return arguments.length?(o=!1,u=+n[0],i=+n[1],a):o?null:[u,i]},a.nodeSize=function(n){return arguments.length?(o=!0,u=+n[0],i=+n[1],a):o?[u,i]:null},a}function u(n){var r=0,t=n.children,e=t&&t.length;if(e)for(;--e>=0;)r+=t[e].value;else r=1;n.value=r}function i(n,r){n instanceof Map?(n=[void 0,n],void 0===r&&(r=a)):void 0===r&&(r=o);for(var t,e,u,i,f,l=new h(n),p=[l];t=p.pop();)if((u=r(t.data))&&(f=(u=Array.from(u)).length))for(t.children=u,i=f-1;i>=0;--i)p.push(e=u[i]=new h(u[i])),e.parent=t,e.depth=t.depth+1;return l.eachBefore(c)}function o(n){return n.children}function a(n){return Array.isArray(n)?n[1]:null}function f(n){void 0!==n.data.value&&(n.value=n.data.value),n.data=n.data.data}function c(n){var r=0;do{n.height=r}while((n=n.parent)&&n.height<++r)}function h(n){this.data=n,this.depth=this.height=0,this.parent=null}function l(n){return null==n?null:p(n)}function p(n){if("function"!=typeof n)throw new Error;return n}function s(){return 0}function d(n){return function(){return n}}h.prototype=i.prototype={constructor:h,count:function(){return this.eachAfter(u)},each:function(n,r){let t=-1;for(const e of this)n.call(r,e,++t,this);return this},eachAfter:function(n,r){for(var t,e,u,i=this,o=[i],a=[],f=-1;i=o.pop();)if(a.push(i),t=i.children)for(e=0,u=t.length;e=0;--e)i.push(t[e]);return this},find:function(n,r){let t=-1;for(const e of this)if(n.call(r,e,++t,this))return e},sum:function(n){return this.eachAfter((function(r){for(var t=+n(r.data)||0,e=r.children,u=e&&e.length;--u>=0;)t+=e[u].value;r.value=t}))},sort:function(n){return this.eachBefore((function(r){r.children&&r.children.sort(n)}))},path:function(n){for(var r=this,t=function(n,r){if(n===r)return n;var t=n.ancestors(),e=r.ancestors(),u=null;n=t.pop(),r=e.pop();for(;n===r;)u=n,n=t.pop(),r=e.pop();return u}(r,n),e=[r];r!==t;)r=r.parent,e.push(r);for(var u=e.length;n!==t;)e.splice(u,0,n),n=n.parent;return e},ancestors:function(){for(var n=this,r=[n];n=n.parent;)r.push(n);return r},descendants:function(){return Array.from(this)},leaves:function(){var n=[];return this.eachBefore((function(r){r.children||n.push(r)})),n},links:function(){var n=this,r=[];return n.each((function(t){t!==n&&r.push({source:t.parent,target:t})})),r},copy:function(){return i(this).eachBefore(f)},[Symbol.iterator]:function*(){var n,r,t,e,u=this,i=[u];do{for(n=i.reverse(),i=[];u=n.pop();)if(yield u,r=u.children)for(t=0,e=r.length;t(n=(v*n+x)%y)/y}function m(n){return w(n,g())}function w(n,r){for(var t,e,u=0,i=(n=function(n,r){let t,e,u=n.length;for(;u;)e=r()*u--|0,t=n[u],n[u]=n[e],n[e]=t;return n}(Array.from(n),r)).length,o=[];u0&&t*t>e*e+u*u}function B(n,r){for(var t=0;t1e-6?(E+Math.sqrt(E*E-4*q*b))/(2*q):b/E);return{x:e+M+z*S,y:u+B+A*S,r:S}}function b(n,r,t){var e,u,i,o,a=n.x-r.x,f=n.y-r.y,c=a*a+f*f;c?(u=r.r+t.r,u*=u,o=n.r+t.r,u>(o*=o)?(e=(c+o-u)/(2*c),i=Math.sqrt(Math.max(0,o/c-e*e)),t.x=n.x-e*a-i*f,t.y=n.y-e*f+i*a):(e=(c+u-o)/(2*c),i=Math.sqrt(Math.max(0,u/c-e*e)),t.x=r.x+e*a-i*f,t.y=r.y+e*f+i*a)):(t.x=r.x+t.r,t.y=r.y)}function S(n,r){var t=n.r+r.r-1e-6,e=r.x-n.x,u=r.y-n.y;return t>0&&t*t>e*e+u*u}function k(n){var r=n._,t=n.next._,e=r.r+t.r,u=(r.x*t.r+t.x*r.r)/e,i=(r.y*t.r+t.y*r.r)/e;return u*u+i*i}function I(n){this._=n,this.next=null,this.previous=null}function O(n,r){if(!(o=(t=n,n="object"==typeof t&&"length"in t?t:Array.from(t)).length))return 0;var t,e,u,i,o,a,f,c,h,l,p,s;if((e=n[0]).x=0,e.y=0,!(o>1))return e.r;if(u=n[1],e.x=-u.r,u.x=e.r,u.y=0,!(o>2))return e.r+u.r;b(u,e,i=n[2]),e=new I(e),u=new I(u),i=new I(i),e.next=i.previous=u,u.next=e.previous=i,i.next=u.previous=e;n:for(c=3;cfunction(n){n=`${n}`;let r=n.length;V(n,r-1)&&!V(n,r-2)&&(n=n.slice(0,-1));return"/"===n[0]?n:`/${n}`}(n(r,t,e)))),t=r.map(U),u=new Set(r).add("");for(const n of t)u.has(n)||(u.add(n),r.push(n),t.push(U(n)),d.push(J));v=(n,t)=>r[t],x=(n,r)=>t[r]}for(o=0,u=d.length;o=0&&(l=d[n]).data===J;--n)l.data=null}if(a.parent=G,a.eachBefore((function(n){n.depth=n.parent.depth+1,--u})).eachBefore(c),a.parent=null,u>0)throw new Error("cycle");return a}return e.id=function(n){return arguments.length?(r=l(n),e):r},e.parentId=function(n){return arguments.length?(t=l(n),e):t},e.path=function(r){return arguments.length?(n=l(r),e):n},e}function U(n){let r=n.length;if(r<2)return"";for(;--r>1&&!V(n,r););return n.slice(0,r)}function V(n,r){if("/"===n[r]){let t=0;for(;r>0&&"\\"===n[--r];)++t;if(0==(1&t))return!0}return!1}function W(n,r){return n.parent===r.parent?1:2}function X(n){var r=n.children;return r?r[0]:n.t}function Y(n){var r=n.children;return r?r[r.length-1]:n.t}function Z(n,r,t){var e=t/(r.i-n.i);r.c-=e,r.s+=t,n.c+=e,r.z+=t,r.m+=t}function nn(n,r,t){return n.a.parent===r.parent?n.a:t}function rn(n,r){this._=n,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=r}function tn(){var n=W,r=1,t=1,e=null;function u(u){var f=function(n){for(var r,t,e,u,i,o=new rn(n,0),a=[o];r=a.pop();)if(e=r._.children)for(r.children=new Array(i=e.length),u=i-1;u>=0;--u)a.push(t=r.children[u]=new rn(e[u],u)),t.parent=r;return(o.parent=new rn(null,0)).children=[o],o}(u);if(f.eachAfter(i),f.parent.m=-f.z,f.eachBefore(o),e)u.eachBefore(a);else{var c=u,h=u,l=u;u.eachBefore((function(n){n.xh.x&&(h=n),n.depth>l.depth&&(l=n)}));var p=c===h?1:n(c,h)/2,s=p-c.x,d=r/(h.x+p+s),v=t/(l.depth||1);u.eachBefore((function(n){n.x=(n.x+s)*d,n.y=n.depth*v}))}return u}function i(r){var t=r.children,e=r.parent.children,u=r.i?e[r.i-1]:null;if(t){!function(n){for(var r,t=0,e=0,u=n.children,i=u.length;--i>=0;)(r=u[i]).z+=t,r.m+=t,t+=r.s+(e+=r.c)}(r);var i=(t[0].z+t[t.length-1].z)/2;u?(r.z=u.z+n(r._,u._),r.m=r.z-i):r.z=i}else u&&(r.z=u.z+n(r._,u._));r.parent.A=function(r,t,e){if(t){for(var u,i=r,o=r,a=t,f=i.parent.children[0],c=i.m,h=o.m,l=a.m,p=f.m;a=Y(a),i=X(i),a&&i;)f=X(f),(o=Y(o)).a=r,(u=a.z+l-i.z-c+n(a._,i._))>0&&(Z(nn(a,r,e),r,u),c+=u,h+=u),l+=a.m,c+=i.m,p+=f.m,h+=o.m;a&&!Y(o)&&(o.t=a,o.m+=l-h),i&&!X(f)&&(f.t=i,f.m+=c-p,e=r)}return e}(r,u,r.parent.A||e[0])}function o(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function a(n){n.x*=r,n.y=n.depth*t}return u.separation=function(r){return arguments.length?(n=r,u):n},u.size=function(n){return arguments.length?(e=!1,r=+n[0],t=+n[1],u):e?null:[r,t]},u.nodeSize=function(n){return arguments.length?(e=!0,r=+n[0],t=+n[1],u):e?[r,t]:null},u}function en(n,r,t,e,u){for(var i,o=n.children,a=-1,f=o.length,c=n.value&&(u-t)/n.value;++ap&&(p=a),x=h*h*v,(s=Math.max(p/x,x/l))>d){h-=a;break}d=s}y.push(o={value:h,dice:f1?r:1)},t}(un);function fn(){var n=an,r=!1,t=1,e=1,u=[0],i=s,o=s,a=s,f=s,c=s;function h(n){return n.x0=n.y0=0,n.x1=t,n.y1=e,n.eachBefore(l),u=[0],r&&n.eachBefore(N),n}function l(r){var t=u[r.depth],e=r.x0+t,h=r.y0+t,l=r.x1-t,p=r.y1-t;l=t-1){var h=a[r];return h.x0=u,h.y0=i,h.x1=o,void(h.y1=f)}var l=c[r],p=e/2+l,s=r+1,d=t-1;for(;s>>1;c[v]f-i){var g=e?(u*y+o*x)/e:o;n(r,s,x,u,i,g,f),n(s,t,y,g,i,o,f)}else{var m=e?(i*y+f*x)/e:f;n(r,s,x,u,i,o,m),n(s,t,y,u,m,o,f)}}(0,f,n.value,r,t,e,u)}function hn(n,r,t,e,u){(1&n.depth?en:C)(n,r,t,e,u)}var ln=function n(r){function t(n,t,e,u,i){if((o=n._squarify)&&o.ratio===r)for(var o,a,f,c,h,l=-1,p=o.length,s=n.value;++l1?r:1)},t}(un);export{h as Node,e as cluster,i as hierarchy,j as pack,m as packEnclose,R as packSiblings,F as partition,Q as stratify,tn as tree,fn as treemap,cn as treemapBinary,C as treemapDice,ln as treemapResquarify,en as treemapSlice,hn as treemapSliceDice,an as treemapSquarify};export default null; diff --git a/_npm/d3-path@3.1.0/_esm.js b/_npm/d3-path@3.1.0/_esm.js new file mode 100644 index 0000000..e0ace87 --- /dev/null +++ b/_npm/d3-path@3.1.0/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/d3-path@3.1.0/src/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +const t=Math.PI,i=2*t,h=1e-6,s=i-h;function _(t){this._+=t[0];for(let i=1,h=t.length;i=0))throw new Error(`invalid digits: ${t}`);if(i>15)return _;const h=10**i;return function(t){this._+=t[0];for(let i=1,s=t.length;ih)if(Math.abs(l*r-o*p)>h&&n){let x=_-$,d=e-a,y=r*r+o*o,M=x*x+d*d,c=Math.sqrt(y),f=Math.sqrt(u),w=n*Math.tan((t-Math.acos((y+u-M)/(2*c*f)))/2),v=w/f,g=w/c;Math.abs(v-1)>h&&this._append`L${i+v*p},${s+v*l}`,this._append`A${n},${n},0,0,${+(l*x>p*d)},${this._x1=i+g*r},${this._y1=s+g*o}`}else this._append`L${this._x1=i},${this._y1=s}`;else;}arc(_,e,n,$,a,r){if(_=+_,e=+e,r=!!r,(n=+n)<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos($),p=n*Math.sin($),l=_+o,u=e+p,x=1^r,d=r?$-a:a-$;null===this._x1?this._append`M${l},${u}`:(Math.abs(this._x1-l)>h||Math.abs(this._y1-u)>h)&&this._append`L${l},${u}`,n&&(d<0&&(d=d%i+i),d>s?this._append`A${n},${n},0,1,${x},${_-o},${e-p}A${n},${n},0,1,${x},${this._x1=l},${this._y1=u}`:d>h&&this._append`A${n},${n},0,${+(d>=t)},${x},${this._x1=_+n*Math.cos(a)},${this._y1=e+n*Math.sin(a)}`)}rect(t,i,h,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+i}h${h=+h}v${+s}h${-h}Z`}toString(){return this._}}function n(){return new e}function $(t=3){return new e(+t)}n.prototype=e.prototype;export{e as Path,n as path,$ as pathRound};export default null; diff --git a/_npm/d3-polygon@3.0.1/_esm.js b/_npm/d3-polygon@3.0.1/_esm.js new file mode 100644 index 0000000..b39300f --- /dev/null +++ b/_npm/d3-polygon@3.0.1/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/d3-polygon@3.0.1/src/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +function n(n){for(var r,t=-1,o=n.length,e=n[o-1],l=0;++t1&&(l=n[t[e-2]],u=n[t[e-1]],f=n[o],(u[0]-l[0])*(f[1]-l[1])-(u[1]-l[1])*(f[0]-l[0])<=0);)--e;t[e++]=o}var l,u,f;return t.slice(0,e)}function e(n){if((e=n.length)<3)return null;var r,e,l=new Array(e),u=new Array(e);for(r=0;r=0;--r)i.push(n[l[f[r]][2]]);for(r=+g;rf!=g>f&&u<(a-t)*(f-o)/(g-o)+t&&(h=!h),a=t,g=o;return h}function u(n){for(var r,t,o=-1,e=n.length,l=n[e-1],u=l[0],f=l[1],a=0;++o=(h=(y+d)/2))?y=h:d=h,(l=r>=(s=(v+p)/2))?v=s:p=s,e=x,!(x=x[_=l<<1|u]))return e[_]=c,t;if(o=+t._x.call(null,x.data),a=+t._y.call(null,x.data),i===o&&r===a)return c.next=x,e?e[_]=c:t._root=c,t;do{e=e?e[_]=new Array(4):t._root=new Array(4),(u=i>=(h=(y+d)/2))?y=h:d=h,(l=r>=(s=(v+p)/2))?v=s:p=s}while((_=l<<1|u)==(f=(a>=s)<<1|o>=h));return e[f]=x,e[_]=c,t}function i(t,i,r,n,e){this.node=t,this.x0=i,this.y0=r,this.x1=n,this.y1=e}function r(t){return t[0]}function n(t){return t[1]}function e(t,i,e){var s=new h(null==i?r:i,null==e?n:e,NaN,NaN,NaN,NaN);return null==t?s:s.addAll(t)}function h(t,i,r,n,e,h){this._x=t,this._y=i,this._x0=r,this._y0=n,this._x1=e,this._y1=h,this._root=void 0}function s(t){for(var i={data:t.data},r=i;t=t.next;)r=r.next={data:t.data};return i}var o=e.prototype=h.prototype;o.copy=function(){var t,i,r=new h(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var e=0;e<4;++e)(i=n.source[e])&&(i.length?t.push({source:i,target:n.target[e]=new Array(4)}):n.target[e]=s(i));return r},o.add=function(i){const r=+this._x.call(null,i),n=+this._y.call(null,i);return t(this.cover(r,n),r,n,i)},o.addAll=function(i){var r,n,e,h,s=i.length,o=new Array(s),a=new Array(s),u=1/0,l=1/0,_=-1/0,f=-1/0;for(n=0;n_&&(_=e),hf&&(f=h));if(u>_||l>f)return this;for(this.cover(u,l).cover(_,f),n=0;nt||t>=e||n>i||i>=h;)switch(o=(ix||(s=u.y0)>c||(o=u.x1)<_||(a=u.y1)=p)<<1|t>=d)&&(u=y[y.length-1],y[y.length-1]=y[y.length-1-l],y[y.length-1-l]=u)}else{var w=t-+this._x.call(null,v.data),N=r-+this._y.call(null,v.data),g=w*w+N*N;if(g=(o=(c+v)/2))?c=o:v=o,(l=s>=(a=(y+d)/2))?y=a:d=a,i=x,!(x=x[_=l<<1|u]))return this;if(!x.length)break;(i[_+1&3]||i[_+2&3]||i[_+3&3])&&(r=i,f=_)}for(;x.data!==t;)if(n=x,!(x=x.next))return this;return(e=x.next)&&delete x.next,n?(e?n.next=e:delete n.next,this):i?(e?i[_]=e:delete i[_],(x=i[0]||i[1]||i[2]||i[3])&&x===(i[3]||i[2]||i[1]||i[0])&&!x.length&&(r?r[f]=x:this._root=x),this):(this._root=e,this)},o.removeAll=function(t){for(var i=0,r=t.length;i1);return r+t*a*Math.sqrt(-2*Math.log(u)/u)}}return t.source=r,t}(r),u=function r(n){var t=o.source(n);function u(){var r=t.apply(this,arguments);return function(){return Math.exp(r())}}return u.source=r,u}(r),a=function r(n){function t(r){return(r=+r)<=0?()=>0:function(){for(var t=0,o=r;o>1;--o)t+=n();return t+o*n()}}return t.source=r,t}(r),e=function r(n){var t=a.source(n);function o(r){if(0==(r=+r))return n;var o=t(r);return function(){return o()/r}}return o.source=r,o}(r),i=function r(n){function t(r){return function(){return-Math.log1p(-n())/r}}return t.source=r,t}(r),c=function r(n){function t(r){if((r=+r)<0)throw new RangeError("invalid alpha");return r=1/-r,function(){return Math.pow(1-n(),r)}}return t.source=r,t}(r),f=function r(n){function t(r){if((r=+r)<0||r>1)throw new RangeError("invalid p");return function(){return Math.floor(n()+r)}}return t.source=r,t}(r),l=function r(n){function t(r){if((r=+r)<0||r>1)throw new RangeError("invalid p");return 0===r?()=>1/0:1===r?()=>1:(r=Math.log1p(-r),function(){return 1+Math.floor(Math.log1p(-n())/r)})}return t.source=r,t}(r),s=function r(n){var t=o.source(n)();function u(r,o){if((r=+r)<0)throw new RangeError("invalid k");if(0===r)return()=>0;if(o=null==o?1:+o,1===r)return()=>-Math.log1p(-n())*o;var u=(r<1?r+1:r)-1/3,a=1/(3*Math.sqrt(u)),e=r<1?()=>Math.pow(n(),1/r):()=>1;return function(){do{do{var r=t(),i=1+a*r}while(i<=0);i*=i*i;var c=1-n()}while(c>=1-.0331*r*r*r*r&&Math.log(c)>=.5*r*r+u*(1-i+Math.log(i)));return u*i*e()*o}}return u.source=r,u}(r),h=function r(n){var t=s.source(n);function o(r,n){var o=t(r),u=t(n);return function(){var r=o();return 0===r?0:r/(r+u())}}return o.source=r,o}(r),M=function r(n){var t=l.source(n),o=h.source(n);function u(r,n){return r=+r,(n=+n)>=1?()=>r:n<=0?()=>0:function(){for(var u=0,a=r,e=n;a*e>16&&a*(1-e)>16;){var i=Math.floor((a+1)*e),c=o(i,a-i+1)();c<=e?(u+=i,a-=i,e=(e-c)/(1-c)):(a=i-1,e/=c)}for(var f=e<.5,l=t(f?e:1-e),s=l(),h=0;s<=a;++h)s+=l();return u+(f?h:a-h)}}return u.source=r,u}(r),v=function r(n){function t(r,t,o){var u;return 0==(r=+r)?u=r=>-Math.log(r):(r=1/r,u=n=>Math.pow(n,r)),t=null==t?0:+t,o=null==o?1:+o,function(){return t+o*u(-Math.log1p(-n()))}}return t.source=r,t}(r),d=function r(n){function t(r,t){return r=null==r?0:+r,t=null==t?1:+t,function(){return r+t*Math.tan(Math.PI*n())}}return t.source=r,t}(r),m=function r(n){function t(r,t){return r=null==r?0:+r,t=null==t?1:+t,function(){var o=n();return r+t*Math.log(o/(1-o))}}return t.source=r,t}(r),g=function r(n){var t=s.source(n),o=M.source(n);function u(r){return function(){for(var u=0,a=r;a>16;){var e=Math.floor(.875*a),i=t(e)();if(i>a)return u+o(e-1,a/i)();u+=e,a-=i}for(var c=-Math.log1p(-n()),f=0;c<=a;++f)c-=Math.log1p(-n());return u+f}}return u.source=r,u}(r);const p=1/4294967296;function w(r=Math.random()){let n=0|(0<=r&&r<1?r/p:Math.abs(r));return()=>(n=1664525*n+1013904223|0,p*(n>>>0))}export{e as randomBates,f as randomBernoulli,h as randomBeta,M as randomBinomial,d as randomCauchy,i as randomExponential,s as randomGamma,l as randomGeometric,t as randomInt,a as randomIrwinHall,w as randomLcg,u as randomLogNormal,m as randomLogistic,o as randomNormal,c as randomPareto,g as randomPoisson,n as randomUniform,v as randomWeibull};export default null; diff --git a/_npm/d3-selection@3.0.0/_esm.js b/_npm/d3-selection@3.0.0/_esm.js new file mode 100644 index 0000000..463e3ed --- /dev/null +++ b/_npm/d3-selection@3.0.0/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/d3-selection@3.0.0/src/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +var t="http://www.w3.org/1999/xhtml",n={svg:"http://www.w3.org/2000/svg",xhtml:t,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function e(t){var e=t+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+1)),n.hasOwnProperty(e)?{space:n[e],local:t}:t}function r(n){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===t&&e.documentElement.namespaceURI===t?e.createElement(n):e.createElementNS(r,n)}}function i(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function o(t){var n=e(t);return(n.local?i:r)(n)}function u(){}function s(t){return null==t?u:function(){return this.querySelector(t)}}function c(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function a(){return[]}function l(t){return null==t?a:function(){return this.querySelectorAll(t)}}function f(t){return function(){return this.matches(t)}}function h(t){return function(n){return n.matches(t)}}var p=Array.prototype.find;function _(){return this.firstElementChild}var d=Array.prototype.filter;function y(){return Array.from(this.children)}function v(t){return new Array(t.length)}function m(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function g(t,n,e,r,i,o){for(var u,s=0,c=n.length,a=o.length;sn?1:t>=n?0:NaN}function b(t){return function(){this.removeAttribute(t)}}function E(t){return function(){this.removeAttributeNS(t.space,t.local)}}function N(t,n){return function(){this.setAttribute(t,n)}}function C(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function L(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function B(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function P(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function T(t){return function(){this.style.removeProperty(t)}}function q(t,n,e){return function(){this.style.setProperty(t,n,e)}}function M(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function D(t,n){return t.style.getPropertyValue(n)||P(t).getComputedStyle(t,null).getPropertyValue(n)}function V(t){return function(){delete this[t]}}function O(t,n){return function(){this[t]=n}}function R(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function j(t){return t.trim().split(/^|\s+/)}function H(t){return t.classList||new I(t)}function I(t){this._node=t,this._names=j(t.getAttribute("class")||"")}function U(t,n){for(var e=H(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var at=[null];function lt(t,n){this._groups=t,this._parents=n}function ft(){return new lt([[document.documentElement]],at)}function ht(t){return"string"==typeof t?new lt([[document.querySelector(t)]],[document.documentElement]):new lt([[t]],at)}function pt(t){return ht(o(t).call(document.documentElement))}lt.prototype=ft.prototype={constructor:lt,select:function(t){"function"!=typeof t&&(t=s(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i=E&&(E=b+1);!(S=v[E])&&++E=0;)(r=i[o])&&(u&&4^r.compareDocumentPosition(u)&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=S);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?T:"function"==typeof n?M:q)(t,n,null==e?"":e)):D(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?V:"function"==typeof n?R:O)(t,n)):this.node()[t]},classed:function(t,n){var e=j(t+"");if(arguments.length<2){for(var r=H(this.node()),i=-1,o=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),u=o.length;if(!(arguments.length<2)){for(s=n?ot:it,r=0;rmt(t,n)))}function wt(t){return"string"==typeof t?new lt([document.querySelectorAll(t)],[document.documentElement]):new lt([c(t)],at)}yt.prototype=dt.prototype={constructor:yt,get:function(t){for(var n=this._;!(n in t);)if(!(t=t.parentNode))return;return t[n]},set:function(t,n){return t[this._]=n},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};export{pt as create,o as creator,dt as local,f as matcher,e as namespace,n as namespaces,mt as pointer,gt as pointers,ht as select,wt as selectAll,ft as selection,s as selector,l as selectorAll,D as style,P as window};export default null; diff --git a/_npm/d3-shape@3.2.0/_esm.js b/_npm/d3-shape@3.2.0/_esm.js new file mode 100644 index 0000000..81ffde0 --- /dev/null +++ b/_npm/d3-shape@3.2.0/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/d3-shape@3.2.0/src/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +import{Path as t}from"../d3-path@3.1.0/_esm.js";function n(t){return function(){return t}}const i=Math.abs,e=Math.atan2,s=Math.cos,o=Math.max,h=Math.min,_=Math.sin,r=Math.sqrt,a=1e-12,l=Math.PI,c=l/2,u=2*l;function f(t){return t>=1?c:t<=-1?-c:Math.asin(t)}function y(n){let i=3;return n.digits=function(t){if(!arguments.length)return i;if(null==t)i=null;else{const n=Math.floor(t);if(!(n>=0))throw new RangeError(`invalid digits: ${t}`);i=n}return n},()=>new t(i)}function x(t){return t.innerRadius}function p(t){return t.outerRadius}function v(t){return t.startAngle}function d(t){return t.endAngle}function T(t){return t&&t.padAngle}function g(t,n,i,e,s,h,_){var a=t-i,l=n-e,c=(_?h:-h)/r(a*a+l*l),u=c*l,f=-c*a,y=t+u,x=n+f,p=i+u,v=e+f,d=(y+p)/2,T=(x+v)/2,g=p-y,m=v-x,b=g*g+m*m,w=s-h,k=y*v-p*x,N=(m<0?-1:1)*r(o(0,w*w*b-k*k)),S=(k*m-g*N)/b,E=(-k*g-m*N)/b,A=(k*m+g*N)/b,M=(-k*g+m*N)/b,P=S-d,C=E-T,O=A-d,R=M-T;return P*P+C*C>O*O+R*R&&(S=A,E=M),{cx:S,cy:E,x01:-u,y01:-f,x11:S*(s/w-1),y11:E*(s/w-1)}}function m(){var t=x,o=p,m=n(0),b=null,w=v,k=d,N=T,S=null,E=y(A);function A(){var n,y,x=+t.apply(this,arguments),p=+o.apply(this,arguments),v=w.apply(this,arguments)-c,d=k.apply(this,arguments)-c,T=i(d-v),A=d>v;if(S||(S=n=E()),pa)if(T>u-a)S.moveTo(p*s(v),p*_(v)),S.arc(0,0,p,v,d,!A),x>a&&(S.moveTo(x*s(d),x*_(d)),S.arc(0,0,x,d,v,A));else{var M,P,C=v,O=d,R=v,z=d,X=T,Y=T,B=N.apply(this,arguments)/2,q=B>a&&(b?+b.apply(this,arguments):r(x*x+p*p)),D=h(i(p-x)/2,+m.apply(this,arguments)),I=D,j=D;if(q>a){var L=f(q/x*_(B)),W=f(q/p*_(B));(X-=2*L)>a?(R+=L*=A?1:-1,z-=L):(X=0,R=z=(v+d)/2),(Y-=2*W)>a?(C+=W*=A?1:-1,O-=W):(Y=0,C=O=(v+d)/2)}var V=p*s(C),$=p*_(C),F=x*s(z),G=x*_(z);if(D>a){var H,J=p*s(O),K=p*_(O),Q=x*s(R),U=x*_(R);if(T1?0:t<-1?l:Math.acos(t)}((Z*nt+tt*it)/(r(Z*Z+tt*tt)*r(nt*nt+it*it)))/2),st=r(H[0]*H[0]+H[1]*H[1]);I=h(D,(x-st)/(et-1)),j=h(D,(p-st)/(et+1))}else I=j=0}Y>a?j>a?(M=g(Q,U,V,$,p,j,A),P=g(J,K,F,G,p,j,A),S.moveTo(M.cx+M.x01,M.cy+M.y01),ja&&X>a?I>a?(M=g(F,G,J,K,x,-I,A),P=g(V,$,Q,U,x,-I,A),S.lineTo(M.cx+M.x01,M.cy+M.y01),I=c;--u)r.point(v[u],d[u]);r.lineEnd(),r.areaEnd()}p&&(v[l]=+t(f,l,n),d[l]=+i(f,l,n),r.point(s?+s(f,l,n):v[l],e?+e(f,l,n):d[l]))}if(y)return r=null,y+""||null}function c(){return A().defined(o).curve(_).context(h)}return t="function"==typeof t?t:void 0===t?S:n(+t),i="function"==typeof i?i:n(void 0===i?0:+i),e="function"==typeof e?e:void 0===e?E:n(+e),l.x=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),s=null,l):t},l.x0=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),l):t},l.x1=function(t){return arguments.length?(s=null==t?null:"function"==typeof t?t:n(+t),l):s},l.y=function(t){return arguments.length?(i="function"==typeof t?t:n(+t),e=null,l):i},l.y0=function(t){return arguments.length?(i="function"==typeof t?t:n(+t),l):i},l.y1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:n(+t),l):e},l.lineX0=l.lineY0=function(){return c().x(t).y(i)},l.lineY1=function(){return c().x(t).y(e)},l.lineX1=function(){return c().x(s).y(i)},l.defined=function(t){return arguments.length?(o="function"==typeof t?t:n(!!t),l):o},l.curve=function(t){return arguments.length?(_=t,null!=h&&(r=_(h)),l):_},l.context=function(t){return arguments.length?(null==t?h=r=null:r=_(h=t),l):h},l}function P(t,n){return nt?1:n>=t?0:NaN}function C(t){return t}function O(){var t=C,i=P,e=null,s=n(0),o=n(u),h=n(0);function _(n){var _,r,a,l,c,f=(n=w(n)).length,y=0,x=new Array(f),p=new Array(f),v=+s.apply(this,arguments),d=Math.min(u,Math.max(-u,o.apply(this,arguments)-v)),T=Math.min(Math.abs(d)/f,h.apply(this,arguments)),g=T*(d<0?-1:1);for(_=0;_0&&(y+=c);for(null!=i?x.sort((function(t,n){return i(p[t],p[n])})):null!=e&&x.sort((function(t,i){return e(n[t],n[i])})),_=0,a=y?(d-f*g)/y:0;_0?c*a:0)+g,p[r]={data:n[r],index:_,value:c,startAngle:v,endAngle:l,padAngle:T};return p}return _.value=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),_):t},_.sortValues=function(t){return arguments.length?(i=t,e=null,_):i},_.sort=function(t){return arguments.length?(e=t,i=null,_):e},_.startAngle=function(t){return arguments.length?(s="function"==typeof t?t:n(+t),_):s},_.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:n(+t),_):o},_.padAngle=function(t){return arguments.length?(h="function"==typeof t?t:n(+t),_):h},_}k.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var R=X(N);function z(t){this._curve=t}function X(t){function n(n){return new z(t(n))}return n._curve=t,n}function Y(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(X(t)):n()._curve},t}function B(){return Y(A().curve(R))}function q(){var t=M().curve(R),n=t.curve,i=t.lineX0,e=t.lineX1,s=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Y(i())},delete t.lineX0,t.lineEndAngle=function(){return Y(e())},delete t.lineX1,t.lineInnerRadius=function(){return Y(s())},delete t.lineY0,t.lineOuterRadius=function(){return Y(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(X(t)):n()._curve},t}function D(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]}z.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};class I{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n)}this._x0=t,this._y0=n}}class j{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,n){if(t=+t,n=+n,0===this._point)this._point=1;else{const i=D(this._x0,this._y0),e=D(this._x0,this._y0=(this._y0+n)/2),s=D(t,this._y0),o=D(t,n);this._context.moveTo(...i),this._context.bezierCurveTo(...e,...s,...o)}this._x0=t,this._y0=n}}function L(t){return new I(t,!0)}function W(t){return new I(t,!1)}function V(t){return new j(t)}function $(t){return t.source}function F(t){return t.target}function G(t){let i=$,e=F,s=S,o=E,h=null,_=null,r=y(a);function a(){let n;const a=b.call(arguments),l=i.apply(this,a),c=e.apply(this,a);if(null==h&&(_=t(n=r())),_.lineStart(),a[0]=l,_.point(+s.apply(this,a),+o.apply(this,a)),a[0]=c,_.point(+s.apply(this,a),+o.apply(this,a)),_.lineEnd(),n)return _=null,n+""||null}return a.source=function(t){return arguments.length?(i=t,a):i},a.target=function(t){return arguments.length?(e=t,a):e},a.x=function(t){return arguments.length?(s="function"==typeof t?t:n(+t),a):s},a.y=function(t){return arguments.length?(o="function"==typeof t?t:n(+t),a):o},a.context=function(n){return arguments.length?(null==n?h=_=null:_=t(h=n),a):h},a}function H(){return G(L)}function J(){return G(W)}function K(){const t=G(V);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const Q=r(3);var U={draw(t,n){const i=.59436*r(n+h(n/28,.75)),e=i/2,s=e*Q;t.moveTo(0,i),t.lineTo(0,-i),t.moveTo(-s,-e),t.lineTo(s,e),t.moveTo(-s,e),t.lineTo(s,-e)}},Z={draw(t,n){const i=r(n/l);t.moveTo(i,0),t.arc(0,0,i,0,u)}},tt={draw(t,n){const i=r(n/5)/2;t.moveTo(-3*i,-i),t.lineTo(-i,-i),t.lineTo(-i,-3*i),t.lineTo(i,-3*i),t.lineTo(i,-i),t.lineTo(3*i,-i),t.lineTo(3*i,i),t.lineTo(i,i),t.lineTo(i,3*i),t.lineTo(-i,3*i),t.lineTo(-i,i),t.lineTo(-3*i,i),t.closePath()}};const nt=r(1/3),it=2*nt;var et={draw(t,n){const i=r(n/it),e=i*nt;t.moveTo(0,-i),t.lineTo(e,0),t.lineTo(0,i),t.lineTo(-e,0),t.closePath()}},st={draw(t,n){const i=.62625*r(n);t.moveTo(0,-i),t.lineTo(i,0),t.lineTo(0,i),t.lineTo(-i,0),t.closePath()}},ot={draw(t,n){const i=.87559*r(n-h(n/7,2));t.moveTo(-i,0),t.lineTo(i,0),t.moveTo(0,i),t.lineTo(0,-i)}},ht={draw(t,n){const i=r(n),e=-i/2;t.rect(e,e,i,i)}},_t={draw(t,n){const i=.4431*r(n);t.moveTo(i,i),t.lineTo(i,-i),t.lineTo(-i,-i),t.lineTo(-i,i),t.closePath()}};const rt=_(l/10)/_(7*l/10),at=_(u/10)*rt,lt=-s(u/10)*rt;var ct={draw(t,n){const i=r(.8908130915292852*n),e=at*i,o=lt*i;t.moveTo(0,-i),t.lineTo(e,o);for(let n=1;n<5;++n){const h=u*n/5,r=s(h),a=_(h);t.lineTo(a*i,-r*i),t.lineTo(r*e-a*o,a*e+r*o)}t.closePath()}};const ut=r(3);var ft={draw(t,n){const i=-r(n/(3*ut));t.moveTo(0,2*i),t.lineTo(-ut*i,-i),t.lineTo(ut*i,-i),t.closePath()}};const yt=r(3);var xt={draw(t,n){const i=.6824*r(n),e=i/2,s=i*yt/2;t.moveTo(0,-i),t.lineTo(s,e),t.lineTo(-s,e),t.closePath()}};const pt=-.5,vt=r(3)/2,dt=1/r(12),Tt=3*(dt/2+1);var gt={draw(t,n){const i=r(n/Tt),e=i/2,s=i*dt,o=e,h=i*dt+i,_=-o,a=h;t.moveTo(e,s),t.lineTo(o,h),t.lineTo(_,a),t.lineTo(pt*e-vt*s,vt*e+pt*s),t.lineTo(pt*o-vt*h,vt*o+pt*h),t.lineTo(pt*_-vt*a,vt*_+pt*a),t.lineTo(pt*e+vt*s,pt*s-vt*e),t.lineTo(pt*o+vt*h,pt*h-vt*o),t.lineTo(pt*_+vt*a,pt*a-vt*_),t.closePath()}},mt={draw(t,n){const i=.6189*r(n-h(n/6,1.7));t.moveTo(-i,-i),t.lineTo(i,i),t.moveTo(-i,i),t.lineTo(i,-i)}};const bt=[Z,tt,et,ht,ct,ft,gt],wt=[Z,ot,mt,xt,U,_t,st];function kt(t,i){let e=null,s=y(o);function o(){let n;if(e||(e=n=s()),t.apply(this,arguments).draw(e,+i.apply(this,arguments)),n)return e=null,n+""||null}return t="function"==typeof t?t:n(t||Z),i="function"==typeof i?i:n(void 0===i?64:+i),o.type=function(i){return arguments.length?(t="function"==typeof i?i:n(i),o):t},o.size=function(t){return arguments.length?(i="function"==typeof t?t:n(+t),o):i},o.context=function(t){return arguments.length?(e=null==t?null:t,o):e},o}function Nt(){}function St(t,n,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+i)/6)}function Et(t){this._context=t}function At(t){return new Et(t)}function Mt(t){this._context=t}function Pt(t){return new Mt(t)}function Ct(t){this._context=t}function Ot(t){return new Ct(t)}function Rt(t,n){this._basis=new Et(t),this._beta=n}Et.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:St(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:St(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},Mt.prototype={areaStart:Nt,areaEnd:Nt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:St(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},Ct.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var i=(this._x0+4*this._x1+t)/6,e=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(i,e):this._context.moveTo(i,e);break;case 3:this._point=4;default:St(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},Rt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,i=t.length-1;if(i>0)for(var e,s=t[0],o=n[0],h=t[i]-s,_=n[i]-o,r=-1;++r<=i;)e=r/i,this._basis.point(this._beta*t[r]+(1-this._beta)*(s+e*h),this._beta*n[r]+(1-this._beta)*(o+e*_));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var zt=function t(n){function i(t){return 1===n?new Et(t):new Rt(t,n)}return i.beta=function(n){return t(+n)},i}(.85);function Xt(t,n,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function Yt(t,n){this._context=t,this._k=(1-n)/6}Yt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Xt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:Xt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Bt=function t(n){function i(t){return new Yt(t,n)}return i.tension=function(n){return t(+n)},i}(0);function qt(t,n){this._context=t,this._k=(1-n)/6}qt.prototype={areaStart:Nt,areaEnd:Nt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Xt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Dt=function t(n){function i(t){return new qt(t,n)}return i.tension=function(n){return t(+n)},i}(0);function It(t,n){this._context=t,this._k=(1-n)/6}It.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Xt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var jt=function t(n){function i(t){return new It(t,n)}return i.tension=function(n){return t(+n)},i}(0);function Lt(t,n,i){var e=t._x1,s=t._y1,o=t._x2,h=t._y2;if(t._l01_a>a){var _=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,r=3*t._l01_a*(t._l01_a+t._l12_a);e=(e*_-t._x0*t._l12_2a+t._x2*t._l01_2a)/r,s=(s*_-t._y0*t._l12_2a+t._y2*t._l01_2a)/r}if(t._l23_a>a){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-n*t._l12_2a)/c,h=(h*l+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(e,s,o,h,t._x2,t._y2)}function Wt(t,n){this._context=t,this._alpha=n}Wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Lt(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Vt=function t(n){function i(t){return n?new Wt(t,n):new Yt(t,0)}return i.alpha=function(n){return t(+n)},i}(.5);function $t(t,n){this._context=t,this._alpha=n}$t.prototype={areaStart:Nt,areaEnd:Nt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Lt(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Ft=function t(n){function i(t){return n?new $t(t,n):new qt(t,0)}return i.alpha=function(n){return t(+n)},i}(.5);function Gt(t,n){this._context=t,this._alpha=n}Gt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Lt(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Ht=function t(n){function i(t){return n?new Gt(t,n):new It(t,0)}return i.alpha=function(n){return t(+n)},i}(.5);function Jt(t){this._context=t}function Kt(t){return new Jt(t)}function Qt(t){return t<0?-1:1}function Ut(t,n,i){var e=t._x1-t._x0,s=n-t._x1,o=(t._y1-t._y0)/(e||s<0&&-0),h=(i-t._y1)/(s||e<0&&-0),_=(o*s+h*e)/(e+s);return(Qt(o)+Qt(h))*Math.min(Math.abs(o),Math.abs(h),.5*Math.abs(_))||0}function Zt(t,n){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-n)/2:n}function tn(t,n,i){var e=t._x0,s=t._y0,o=t._x1,h=t._y1,_=(o-e)/3;t._context.bezierCurveTo(e+_,s+_*n,o-_,h-_*i,o,h)}function nn(t){this._context=t}function en(t){this._context=new sn(t)}function sn(t){this._context=t}function on(t){return new nn(t)}function hn(t){return new en(t)}function _n(t){this._context=t}function rn(t){var n,i,e=t.length-1,s=new Array(e),o=new Array(e),h=new Array(e);for(s[0]=0,o[0]=2,h[0]=t[0]+2*t[1],n=1;n=0;--n)s[n]=(h[n]-s[n+1])/o[n];for(o[e-1]=(t[e]+s[e-1])/2,n=0;n1)for(var i,e,s,o=1,h=t[n[0]],_=h.length;o=0;)i[n]=n;return i}function pn(t,n){return t[n]}function vn(t){const n=[];return n.key=t,n}function dn(){var t=n([]),i=xn,e=yn,s=pn;function o(n){var o,h,_=Array.from(t.apply(this,arguments),vn),r=_.length,a=-1;for(const t of n)for(o=0,++a;o0){for(var i,e,s,o=0,h=t[0].length;o0)for(var i,e,s,o,h,_,r=0,a=t[n[0]].length;r0?(e[0]=o,e[1]=o+=s):s<0?(e[1]=h,e[0]=h+=s):(e[0]=0,e[1]=s)}function mn(t,n){if((i=t.length)>0){for(var i,e=0,s=t[n[0]],o=s.length;e0&&(e=(i=t[n[0]]).length)>0){for(var i,e,s,o=0,h=1;ho&&(o=n,e=i);return e}function Nn(t){var n=t.map(Sn);return xn(t).sort((function(t,i){return n[t]-n[i]}))}function Sn(t){for(var n,i=0,e=-1,s=t.length;++e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var i=this._x*(1-this._t)+t*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,n)}}this._x=t,this._y=n}};export{m as arc,M as area,q as areaRadial,At as curveBasis,Pt as curveBasisClosed,Ot as curveBasisOpen,L as curveBumpX,W as curveBumpY,zt as curveBundle,Bt as curveCardinal,Dt as curveCardinalClosed,jt as curveCardinalOpen,Vt as curveCatmullRom,Ft as curveCatmullRomClosed,Ht as curveCatmullRomOpen,N as curveLinear,Kt as curveLinearClosed,on as curveMonotoneX,hn as curveMonotoneY,an as curveNatural,cn as curveStep,fn as curveStepAfter,un as curveStepBefore,A as line,B as lineRadial,G as link,H as linkHorizontal,K as linkRadial,J as linkVertical,O as pie,D as pointRadial,q as radialArea,B as radialLine,dn as stack,gn as stackOffsetDiverging,Tn as stackOffsetExpand,yn as stackOffsetNone,mn as stackOffsetSilhouette,bn as stackOffsetWiggle,wn as stackOrderAppearance,Nn as stackOrderAscending,En as stackOrderDescending,An as stackOrderInsideOut,xn as stackOrderNone,Mn as stackOrderReverse,kt as symbol,U as symbolAsterisk,Z as symbolCircle,tt as symbolCross,et as symbolDiamond,st as symbolDiamond2,ot as symbolPlus,ht as symbolSquare,_t as symbolSquare2,ct as symbolStar,mt as symbolTimes,ft as symbolTriangle,xt as symbolTriangle2,gt as symbolWye,mt as symbolX,bt as symbols,bt as symbolsFill,wt as symbolsStroke};export default null; diff --git a/_npm/d3-timer@3.0.1/_esm.js b/_npm/d3-timer@3.0.1/_esm.js new file mode 100644 index 0000000..4ef8a86 --- /dev/null +++ b/_npm/d3-timer@3.0.1/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/d3-timer@3.0.1/src/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +var t,n,e=0,r=0,o=0,i=1e3,a=0,l=0,u=0,c="object"==typeof performance&&performance.now?performance:Date,s="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function f(){return l||(s(_),l=c.now()+u)}function _(){l=0}function w(){this._call=this._time=this._next=null}function m(t,n,e){var r=new w;return r.restart(t,n,e),r}function p(){f(),++e;for(var n,r=t;r;)(n=l-r._time)>=0&&r._call.call(void 0,n),r=r._next;--e}function h(){l=(a=c.now())+u,e=r=0;try{p()}finally{e=0,function(){var e,r,o=t,i=1/0;for(;o;)o._call?(i>o._time&&(i=o._time),e=o,o=o._next):(r=o._next,o._next=null,o=e?e._next=r:t=r);n=e,x(i)}(),l=0}}function v(){var t=c.now(),n=t-a;n>i&&(u-=n,a=t)}function x(t){e||(r&&(r=clearTimeout(r)),t-l>24?(t<1/0&&(r=setTimeout(h,t-c.now()-u)),o&&(o=clearInterval(o))):(o||(a=c.now(),o=setInterval(v,i)),e=1,s(h)))}function y(t,n,e){var r=new w;return n=null==n?0:+n,r.restart((e=>{r.stop(),t(e+n)}),n,e),r}function d(t,n,e){var r=new w,o=n;return null==n?(r.restart(t,n,e),r):(r._restart=r.restart,r.restart=function(t,n,e){n=+n,e=null==e?f():+e,r._restart((function i(a){a+=o,r._restart(i,o+=n,e),t(a)}),n,e)},r.restart(t,n,e),r)}w.prototype=m.prototype={constructor:w,restart:function(e,r,o){if("function"!=typeof e)throw new TypeError("callback is not a function");o=(null==o?f():+o)+(null==r?0:+r),this._next||n===this||(n?n._next=this:t=this,n=this),this._call=e,this._time=o,x()},stop:function(){this._call&&(this._call=null,this._time=1/0,x())}};export{d as interval,f as now,y as timeout,m as timer,p as timerFlush};export default null; diff --git a/_npm/d3-transition@3.0.1/_esm.js b/_npm/d3-transition@3.0.1/_esm.js new file mode 100644 index 0000000..82c04bb --- /dev/null +++ b/_npm/d3-transition@3.0.1/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/d3-transition@3.0.1/src/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +import{namespace as t,matcher as n,selector as e,selectorAll as r,selection as i,style as o}from"../d3-selection@3.0.0/_esm.js";import{dispatch as u}from"../d3-dispatch@3.0.1/_esm.js";import{timer as a,timeout as s,now as l}from"../d3-timer@3.0.1/_esm.js";import{interpolateNumber as f,interpolateRgb as c,interpolateString as h,interpolateTransformSvg as _,interpolateTransformCss as p}from"../d3-interpolate@3.0.1/_esm.js";import{color as v}from"../d3-color@3.1.0/_esm.js";import{easeCubicInOut as d}from"../d3-ease@3.0.1/_esm.js";var m=u("start","end","cancel","interrupt"),y=[],w=0,g=1,x=2,A=3,b=4,E=5,C=6;function N(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(t){e.state=g,e.timer.restart(u,e.delay,e.time),e.delay<=t&&u(t-e.delay)}function u(o){var a,c,h,_;if(e.state!==g)return f();for(a in i)if((_=i[a]).name===e.name){if(_.state===A)return s(u);_.state===b?(_.state=C,_.timer.stop(),_.on.call("interrupt",t,t.__data__,_.index,_.group),delete i[a]):+aw)throw new Error("too late; already scheduled");return e}function T(t,n){var e=P(t,n);if(e.state>A)throw new Error("too late; already running");return e}function P(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function z(t,n){var e,r,i,o=t.__transition,u=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>x&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?S:T;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}(e,t,n))},attr:function(n,e){var r=t(n),i="transform"===r?_:V;return this.attrTween(n,"function"==typeof e?(r.local?F:D)(r,i,O(this,"attr."+n,e)):null==e?(r.local?j:$)(r):(r.local?B:q)(r,i,e))},attrTween:function(n,e){var r="attr."+n;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;var i=t(n);return this.tween(r,(i.local?G:H)(i,e))},style:function(t,n,e){var r="transform"==(t+="")?p:V;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var u=o(this,t),a=(this.style.removeProperty(t),o(this,t));return u===a?null:u===e&&a===r?i:i=n(e=u,r=a)}}(t,r)).on("end.style."+t,R(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,u;return function(){var a=o(this,t),s=e(this),l=s+"";return null==s&&(this.style.removeProperty(t),l=s=o(this,t)),a===l?null:a===r&&l===i?u:(i=l,u=n(r=a,s))}}(t,r,O(this,"style."+t,n))).each(function(t,n){var e,r,i,o,u="style."+n,a="end."+u;return function(){var s=T(this,t),l=s.on,f=null==s.value[u]?o||(o=R(n)):void 0;l===e&&i===f||(r=(e=l).copy()).on(a,i=f),s.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,u=e+"";return function(){var a=o(this,t);return a===u?null:a===r?i:i=n(r=a,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}(t,o,e)),r}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(O(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,function(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&function(t){return function(n){this.textContent=t.call(this,n)}}(r)),n}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=P(this.node(),e).tween,o=0,u=i.length;og&&e.name===n)return new W([[t]],et,n,+r);return null}export{rt as active,z as interrupt,X as transition};export default null; diff --git a/_npm/d3-zoom@3.0.0/_esm.js b/_npm/d3-zoom@3.0.0/_esm.js new file mode 100644 index 0000000..df6e03f --- /dev/null +++ b/_npm/d3-zoom@3.0.0/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/d3-zoom@3.0.0/src/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +import{dispatch as t}from"../d3-dispatch@3.0.1/_esm.js";import{dragDisable as n,dragEnable as e}from"../d3-drag@3.0.0/_esm.js";import{interpolateZoom as o}from"../d3-interpolate@3.0.1/_esm.js";import{select as i,pointer as r}from"../d3-selection@3.0.0/_esm.js";import{interrupt as u}from"../d3-transition@3.0.1/_esm.js";var h=t=>()=>t;function s(t,{sourceEvent:n,target:e,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function a(t,n,e){this.k=t,this.x=n,this.y=e}a.prototype={constructor:a,scale:function(t){return 1===t?this:new a(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new a(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var c=new a(1,0,0);function l(t){for(;!t.__zoom;)if(!(t=t.parentNode))return c;return t.__zoom}function f(t){t.stopImmediatePropagation()}function m(t){t.preventDefault(),t.stopImmediatePropagation()}function p(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function v(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function y(){return this.__zoom||c}function d(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function z(){return navigator.maxTouchPoints||"ontouchstart"in this}function _(t,n,e){var o=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],r=t.invertY(n[0][1])-e[0][1],u=t.invertY(n[1][1])-e[1][1];return t.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),u>r?(r+u)/2:Math.min(0,r)||Math.max(0,u))}function g(){var l,g,k,x=p,w=v,b=_,T=d,M=z,E=[0,1/0],Y=[[-1/0,-1/0],[1/0,1/0]],X=250,V=o,B=t("start","zoom","end"),D=500,P=150,I=0,K=10;function S(t){t.property("__zoom",y).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",W).on("dblclick.zoom",Z).filter(M).on("touchstart.zoom",C).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",J).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function q(t,n){return(n=Math.max(E[0],Math.min(E[1],n)))===t.k?t:new a(n,t.x,t.y)}function G(t,n,e){var o=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return o===t.x&&i===t.y?t:new a(t.k,o,i)}function j(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function A(t,n,e,o){t.on("start.zoom",(function(){H(this,arguments).event(o).start()})).on("interrupt.zoom end.zoom",(function(){H(this,arguments).event(o).end()})).tween("zoom",(function(){var t=this,i=arguments,r=H(t,i).event(o),u=w.apply(t,i),h=null==e?j(u):"function"==typeof e?e.apply(t,i):e,s=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),c=t.__zoom,l="function"==typeof n?n.apply(t,i):n,f=V(c.invert(h).concat(s/c.k),l.invert(h).concat(s/l.k));return function(t){if(1===t)t=l;else{var n=f(t),e=s/n[2];t=new a(e,h[0]-n[0]*e,h[1]-n[1]*e)}r.zoom(null,t)}}))}function H(t,n,e){return!e&&t.__zooming||new N(t,n)}function N(t,n){this.that=t,this.args=n,this.active=0,this.sourceEvent=null,this.extent=w.apply(t,n),this.taps=0}function O(t,...n){if(x.apply(this,arguments)){var e=H(this,n).event(t),o=this.__zoom,i=Math.max(E[0],Math.min(E[1],o.k*Math.pow(2,T.apply(this,arguments)))),h=r(t);if(e.wheel)e.mouse[0][0]===h[0]&&e.mouse[0][1]===h[1]||(e.mouse[1]=o.invert(e.mouse[0]=h)),clearTimeout(e.wheel);else{if(o.k===i)return;e.mouse=[h,o.invert(h)],u(this),e.start()}m(t),e.wheel=setTimeout((function(){e.wheel=null,e.end()}),P),e.zoom("mouse",b(G(q(o,i),e.mouse[0],e.mouse[1]),e.extent,Y))}}function W(t,...o){if(!k&&x.apply(this,arguments)){var h=t.currentTarget,s=H(this,o,!0).event(t),a=i(t.view).on("mousemove.zoom",(function(t){if(m(t),!s.moved){var n=t.clientX-l,e=t.clientY-p;s.moved=n*n+e*e>I}s.event(t).zoom("mouse",b(G(s.that.__zoom,s.mouse[0]=r(t,h),s.mouse[1]),s.extent,Y))}),!0).on("mouseup.zoom",(function(t){a.on("mousemove.zoom mouseup.zoom",null),e(t.view,s.moved),m(t),s.event(t).end()}),!0),c=r(t,h),l=t.clientX,p=t.clientY;n(t.view),f(t),s.mouse=[c,this.__zoom.invert(c)],u(this),s.start()}}function Z(t,...n){if(x.apply(this,arguments)){var e=this.__zoom,o=r(t.changedTouches?t.changedTouches[0]:t,this),u=e.invert(o),h=e.k*(t.shiftKey?.5:2),s=b(G(q(e,h),o,u),w.apply(this,n),Y);m(t),X>0?i(this).transition().duration(X).call(A,s,o,t):i(this).call(S.transform,s,o,t)}}function C(t,...n){if(x.apply(this,arguments)){var e,o,i,h,s=t.touches,a=s.length,c=H(this,n,t.changedTouches.length===a).event(t);for(f(t),o=0;o>1;if(s>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*s-5,0);this._triangles=new Uint32Array(3*i),this._halfedges=new Int32Array(3*i),this._hashSize=Math.ceil(Math.sqrt(s)),this._hullPrev=new Uint32Array(s),this._hullNext=new Uint32Array(s),this._hullTri=new Uint32Array(s),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(s),this._dists=new Float64Array(s),this.update()}update(){const{coords:i,_hullPrev:e,_hullNext:n,_hullTri:a,_hullHash:o}=this,_=i.length>>1;let c=1/0,f=1/0,u=-1/0,d=-1/0;for(let t=0;t<_;t++){const s=i[2*t],e=i[2*t+1];su&&(u=s),e>d&&(d=e),this._ids[t]=t}const g=(c+u)/2,y=(f+d)/2;let w,b,A;for(let t=0,s=1/0;t<_;t++){const e=h(g,y,i[2*t],i[2*t+1]);e0&&(b=t,s=e)}let x=i[2*b],z=i[2*b+1],U=1/0;for(let t=0;t<_;t++){if(t===w||t===b)continue;const s=r(k,S,x,z,i[2*t],i[2*t+1]);se&&(t[s++]=h,e=n)}return this.hull=t.subarray(0,s),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(t(k,S,x,z,p,M)<0){const t=b,s=x,i=z;b=A,x=p,z=M,A=t,p=s,M=i}const T=function(t,s,i,e,h,n){const r=i-t,l=e-s,a=h-t,o=n-s,_=r*r+l*l,c=a*a+o*o,f=.5/(r*o-l*a);return{x:t+(o*_-l*c)*f,y:s+(r*c-a*_)*f}}(k,S,x,z,p,M);this._cx=T.x,this._cy=T.y;for(let t=0;t<_;t++)this._dists[t]=h(i[2*t],i[2*t+1],T.x,T.y);l(this._ids,this._dists,0,_-1),this._hullStart=w;let m=3;n[w]=e[A]=b,n[b]=e[w]=A,n[A]=e[b]=w,a[w]=0,a[b]=1,a[A]=2,o.fill(-1),o[this._hashKey(k,S)]=w,o[this._hashKey(x,z)]=b,o[this._hashKey(p,M)]=A,this.trianglesLen=0,this._addTriangle(w,b,A,-1,-1,-1);for(let h,r,l=0;l0&&Math.abs(c-h)<=s&&Math.abs(f-r)<=s)continue;if(h=c,r=f,_===w||_===b||_===A)continue;let u=0;for(let t=0,s=this._hashKey(c,f);t=0;)if(g=d,g===u){g=-1;break}if(-1===g)continue;let y=this._addTriangle(g,_,n[g],-1,-1,a[g]);a[_]=this._legalize(y+2),a[g]=y,m++;let k=n[g];for(;d=n[k],t(c,f,i[2*k],i[2*k+1],i[2*d],i[2*d+1])<0;)y=this._addTriangle(k,_,d,a[_],-1,a[k]),a[_]=this._legalize(y+2),n[k]=k,m--,k=d;if(g===u)for(;d=e[g],t(c,f,i[2*d],i[2*d+1],i[2*g],i[2*g+1])<0;)y=this._addTriangle(d,_,g,-1,a[g],a[d]),this._legalize(y+2),a[d]=y,n[g]=g,m--,g=d;this._hullStart=e[_]=g,n[g]=e[k]=_,n[_]=k,o[this._hashKey(c,f)]=_,o[this._hashKey(i[2*g],i[2*g+1])]=g}this.hull=new Uint32Array(m);for(let t=0,s=this._hullStart;t0?3-i:1+i)/4}(t-this._cx,s-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:s,_halfedges:e,coords:h}=this;let r=0,l=0;for(;;){const a=e[t],o=t-t%3;if(l=o+(t+2)%3,-1===a){if(0===r)break;t=i[--r];continue}const _=a-a%3,c=o+(t+1)%3,f=_+(a+2)%3,u=s[l],d=s[t],g=s[c],y=s[f];if(n(h[2*u],h[2*u+1],h[2*d],h[2*d+1],h[2*g],h[2*g+1],h[2*y],h[2*y+1])){s[t]=y,s[a]=u;const h=e[f];if(-1===h){let s=this._hullStart;do{if(this._hullTri[s]===f){this._hullTri[s]=t;break}s=this._hullPrev[s]}while(s!==this._hullStart)}this._link(t,h),this._link(a,e[l]),this._link(l,f);const n=_+(a+1)%3;r=i&&s[t[r]]>n;)t[r+1]=t[r--];t[r+1]=e}else{let h=i+1,n=e;a(t,i+e>>1,h),s[t[i]]>s[t[e]]&&a(t,i,e),s[t[h]]>s[t[e]]&&a(t,h,e),s[t[i]]>s[t[h]]&&a(t,i,h);const r=t[h],o=s[r];for(;;){do{h++}while(s[t[h]]o);if(n=n-i?(l(t,s,h,e),l(t,s,i,n-1)):(l(t,s,i,n-1),l(t,s,h,e))}}function a(t,s,i){const e=t[s];t[s]=t[i],t[i]=e}function o(t){return t[0]}function _(t){return t[1]}export{e as default}; diff --git a/_npm/interval-tree-1d@1.0.4/_esm.js b/_npm/interval-tree-1d@1.0.4/_esm.js new file mode 100644 index 0000000..254a849 --- /dev/null +++ b/_npm/interval-tree-1d@1.0.4/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/interval-tree-1d@1.0.4/interval-tree.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +import t from"../binary-search-bounds@2.0.5/_esm.js";var i=t,r=function(t){if(!t||0===t.length)return new m(null);return new m(v(t))};function n(t,i,r,n,s){this.mid=t,this.left=i,this.right=r,this.leftPoints=n,this.rightPoints=s,this.count=(i?i.count:0)+(r?r.count:0)+n.length}var s=n.prototype;function h(t,i){t.mid=i.mid,t.left=i.left,t.right=i.right,t.leftPoints=i.leftPoints,t.rightPoints=i.rightPoints,t.count=i.count}function e(t,i){var r=v(i);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function o(t,i){var r=t.intervals([]);r.push(i),e(t,r)}function f(t,i){var r=t.intervals([]),n=r.indexOf(i);return n<0?0:(r.splice(n,1),e(t,r),1)}function u(t,i,r){for(var n=0;n=0&&t[n][1]>=i;--n){var s=r(t[n]);if(s)return s}}function g(t,i){for(var r=0;r>1],h=[],e=[],o=[];for(r=0;r3*(r+1)?o(this,t):this.left.insert(t):this.left=v([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(r+1)?o(this,t):this.right.insert(t):this.right=v([t]);else{var n=i.ge(this.leftPoints,t,P),s=i.ge(this.rightPoints,t,a);this.leftPoints.splice(n,0,t),this.rightPoints.splice(s,0,t)}},s.remove=function(t){var r=this.count-this.leftPoints;if(t[1]3*(r-1)?f(this,t):2===(o=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===o&&(this.count-=1),o):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(r-1)?f(this,t):2===(o=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===o&&(this.count-=1),o):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var n=this,s=this.left;s.right;)n=s,s=s.right;if(n===this)s.right=this.right;else{var e=this.left,o=this.right;n.count-=s.count,n.right=s.left,s.left=e,s.right=o}h(this,s),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?h(this,this.left):h(this,this.right);return 1}for(e=i.ge(this.leftPoints,t,P);ethis.mid){var r;if(this.right)if(r=this.right.queryPoint(t,i))return r;return l(this.rightPoints,t,i)}return g(this.leftPoints,i)},s.queryInterval=function(t,i,r){var n;if(tthis.mid&&this.right&&(n=this.right.queryInterval(t,i,r)))return n;return ithis.mid?l(this.rightPoints,t,r):g(this.leftPoints,r)};var p=m.prototype;p.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},p.remove=function(t){if(this.root){var i=this.root.remove(t);return 2===i&&(this.root=null),0!==i}return!1},p.queryPoint=function(t,i){if(this.root)return this.root.queryPoint(t,i)},p.queryInterval=function(t,i,r){if(t<=i&&this.root)return this.root.queryInterval(t,i,r)},Object.defineProperty(p,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(p,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});export{r as default}; diff --git a/_npm/robust-predicates@3.0.2/_esm.js b/_npm/robust-predicates@3.0.2/_esm.js new file mode 100644 index 0000000..0380490 --- /dev/null +++ b/_npm/robust-predicates@3.0.2/_esm.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/robust-predicates@3.0.2/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +const t=11102230246251565e-32,n=134217729,r=(3+8*t)*t;function s(t,n,r,s,a){let e,o,c,u,f=n[0],i=s[0],b=0,h=0;i>f==i>-f?(e=f,f=n[++b]):(e=i,i=s[++h]);let M=0;if(bf==i>-f?(o=f+e,c=e-(o-f),f=n[++b]):(o=i+e,c=e-(o-i),i=s[++h]),e=o,0!==c&&(a[M++]=c);bf==i>-f?(o=e+f,u=o-e,c=e-(o-u)+(f-u),f=n[++b]):(o=e+i,u=o-e,c=e-(o-u)+(i-u),i=s[++h]),e=o,0!==c&&(a[M++]=c);for(;b=33306690738754716e-32*A?y:-function(t,a,e,o,u,x,d){let w,y,A,F,g,j,k,m,q,v,z,B,C,D,E,G,H,I;const J=t-u,K=e-u,L=a-x,N=o-x;D=J*N,j=n*J,k=j-(j-J),m=J-k,j=n*N,q=j-(j-N),v=N-q,E=m*v-(D-k*q-m*q-k*v),G=L*K,j=n*L,k=j-(j-L),m=L-k,j=n*K,q=j-(j-K),v=K-q,H=m*v-(G-k*q-m*q-k*v),z=E-H,g=E-z,b[0]=E-(z+g)+(g-H),B=D+z,g=B-D,C=D-(B-g)+(z-g),z=C-G,g=C-z,b[1]=C-(z+g)+(g-G),I=B+z,g=I-B,b[2]=B-(I-g)+(z-g),b[3]=I;let O=c(4,b),P=f*d;if(O>=P||-O>=P)return O;if(g=t-J,w=t-(J+g)+(g-u),g=e-K,A=e-(K+g)+(g-u),g=a-L,y=a-(L+g)+(g-x),g=o-N,F=o-(N+g)+(g-x),0===w&&0===y&&0===A&&0===F)return O;if(P=i*d+r*Math.abs(O),O+=J*F+N*w-(L*A+K*y),O>=P||-O>=P)return O;D=w*N,j=n*w,k=j-(j-w),m=w-k,j=n*N,q=j-(j-N),v=N-q,E=m*v-(D-k*q-m*q-k*v),G=y*K,j=n*y,k=j-(j-y),m=y-k,j=n*K,q=j-(j-K),v=K-q,H=m*v-(G-k*q-m*q-k*v),z=E-H,g=E-z,p[0]=E-(z+g)+(g-H),B=D+z,g=B-D,C=D-(B-g)+(z-g),z=C-G,g=C-z,p[1]=C-(z+g)+(g-G),I=B+z,g=I-B,p[2]=B-(I-g)+(z-g),p[3]=I;const Q=s(4,b,4,p,h);D=J*F,j=n*J,k=j-(j-J),m=J-k,j=n*F,q=j-(j-F),v=F-q,E=m*v-(D-k*q-m*q-k*v),G=L*A,j=n*L,k=j-(j-L),m=L-k,j=n*A,q=j-(j-A),v=A-q,H=m*v-(G-k*q-m*q-k*v),z=E-H,g=E-z,p[0]=E-(z+g)+(g-H),B=D+z,g=B-D,C=D-(B-g)+(z-g),z=C-G,g=C-z,p[1]=C-(z+g)+(g-G),I=B+z,g=I-B,p[2]=B-(I-g)+(z-g),p[3]=I;const R=s(Q,h,4,p,M);D=w*F,j=n*w,k=j-(j-w),m=w-k,j=n*F,q=j-(j-F),v=F-q,E=m*v-(D-k*q-m*q-k*v),G=y*A,j=n*y,k=j-(j-y),m=y-k,j=n*A,q=j-(j-A),v=A-q,H=m*v-(G-k*q-m*q-k*v),z=E-H,g=E-z,p[0]=E-(z+g)+(g-H),B=D+z,g=B-D,C=D-(B-g)+(z-g),z=C-G,g=C-z,p[1]=C-(z+g)+(g-G),I=B+z,g=I-B,p[2]=B-(I-g)+(z-g),p[3]=I;const S=s(R,M,4,p,l);return l[S-1]}(t,a,e,o,u,x,A)}function d(t,n,r,s,a,e){return(n-e)*(r-a)-(t-a)*(s-e)}const w=3330669073875473e-31,y=32047474274603644e-47,A=u(4),F=u(4),g=u(4),j=u(4),k=u(4),m=u(4),q=u(4),v=u(4),z=u(4),B=u(8),C=u(8),D=u(8),E=u(4),G=u(8),H=u(8),I=u(8),J=u(12);let K=u(192),L=u(192);function N(t,n,r){t=s(t,K,n,r,L);const a=K;return K=L,L=a,t}function O(t,r,s,a,e,o,c,u){let f,i,b,h,M,l,p,x,d,w,y,A,F,g,j;return 0===t?0===r?(c[0]=0,u[0]=0,1):(j=-r,w=j*s,i=n*j,b=i-(i-j),h=j-b,i=n*s,M=i-(i-s),l=s-M,c[0]=h*l-(w-b*M-h*M-b*l),c[1]=w,w=r*e,i=n*r,b=i-(i-r),h=r-b,i=n*e,M=i-(i-e),l=e-M,u[0]=h*l-(w-b*M-h*M-b*l),u[1]=w,2):0===r?(w=t*a,i=n*t,b=i-(i-t),h=t-b,i=n*a,M=i-(i-a),l=a-M,c[0]=h*l-(w-b*M-h*M-b*l),c[1]=w,j=-t,w=j*o,i=n*j,b=i-(i-j),h=j-b,i=n*o,M=i-(i-o),l=o-M,u[0]=h*l-(w-b*M-h*M-b*l),u[1]=w,2):(w=t*a,i=n*t,b=i-(i-t),h=t-b,i=n*a,M=i-(i-a),l=a-M,y=h*l-(w-b*M-h*M-b*l),A=r*s,i=n*r,b=i-(i-r),h=r-b,i=n*s,M=i-(i-s),l=s-M,F=h*l-(A-b*M-h*M-b*l),p=y-F,f=y-p,c[0]=y-(p+f)+(f-F),x=w+p,f=x-w,d=w-(x-f)+(p-f),p=d-A,f=d-p,c[1]=d-(p+f)+(f-A),g=x+p,f=g-x,c[2]=x-(g-f)+(p-f),c[3]=g,w=r*e,i=n*r,b=i-(i-r),h=r-b,i=n*e,M=i-(i-e),l=e-M,y=h*l-(w-b*M-h*M-b*l),A=t*o,i=n*t,b=i-(i-t),h=t-b,i=n*o,M=i-(i-o),l=o-M,F=h*l-(A-b*M-h*M-b*l),p=y-F,f=y-p,u[0]=y-(p+f)+(f-F),x=w+p,f=x-w,d=w-(x-f)+(p-f),p=d-A,f=d-p,u[1]=d-(p+f)+(f-A),g=x+p,f=g-x,u[2]=x-(g-f)+(p-f),u[3]=g,4)}function P(t,r,s,a,e){let o,c,u,f,i,b,h,M,l,p,x,d,w;return x=r*s,c=n*r,u=c-(c-r),f=r-u,c=n*s,i=c-(c-s),b=s-i,d=f*b-(x-u*i-f*i-u*b),c=n*a,i=c-(c-a),b=a-i,h=d*a,c=n*d,u=c-(c-d),f=d-u,E[0]=f*b-(h-u*i-f*i-u*b),M=x*a,c=n*x,u=c-(c-x),f=x-u,p=f*b-(M-u*i-f*i-u*b),l=h+p,o=l-h,E[1]=h-(l-o)+(p-o),w=M+l,E[2]=l-(w-M),E[3]=w,t=N(t,4,E),0!==e&&(c=n*e,i=c-(c-e),b=e-i,h=d*e,c=n*d,u=c-(c-d),f=d-u,E[0]=f*b-(h-u*i-f*i-u*b),M=x*e,c=n*x,u=c-(c-x),f=x-u,p=f*b-(M-u*i-f*i-u*b),l=h+p,o=l-h,E[1]=h-(l-o)+(p-o),w=M+l,E[2]=l-(w-M),E[3]=w,t=N(t,4,E)),t}function Q(t,a,o,u,f,i,b,h,M,l,p,x){const d=t-l,E=u-l,L=b-l,Q=a-p,R=f-p,S=h-p,T=o-x,U=i-x,V=M-x,W=E*S,X=L*R,Y=L*Q,Z=d*S,$=d*R,_=E*Q,tt=T*(W-X)+U*(Y-Z)+V*($-_),nt=(Math.abs(W)+Math.abs(X))*Math.abs(T)+(Math.abs(Y)+Math.abs(Z))*Math.abs(U)+(Math.abs($)+Math.abs(_))*Math.abs(V),rt=7771561172376103e-31*nt;return tt>rt||-tt>rt?tt:function(t,a,o,u,f,i,b,h,M,l,p,x,d){let E,L,Q,R,S,T,U,V,W,X,Y,Z,$,_,tt,nt,rt,st,at,et,ot,ct,ut,ft;const it=t-l,bt=u-l,ht=b-l,Mt=a-p,lt=f-p,pt=h-p,xt=o-x,dt=i-x,wt=M-x;et=bt*pt,Z=n*bt,$=Z-(Z-bt),_=bt-$,Z=n*pt,tt=Z-(Z-pt),nt=pt-tt,ot=_*nt-(et-$*tt-_*tt-$*nt),ct=ht*lt,Z=n*ht,$=Z-(Z-ht),_=ht-$,Z=n*lt,tt=Z-(Z-lt),nt=lt-tt,ut=_*nt-(ct-$*tt-_*tt-$*nt),rt=ot-ut,Y=ot-rt,A[0]=ot-(rt+Y)+(Y-ut),st=et+rt,Y=st-et,at=et-(st-Y)+(rt-Y),rt=at-ct,Y=at-rt,A[1]=at-(rt+Y)+(Y-ct),ft=st+rt,Y=ft-st,A[2]=st-(ft-Y)+(rt-Y),A[3]=ft,et=ht*Mt,Z=n*ht,$=Z-(Z-ht),_=ht-$,Z=n*Mt,tt=Z-(Z-Mt),nt=Mt-tt,ot=_*nt-(et-$*tt-_*tt-$*nt),ct=it*pt,Z=n*it,$=Z-(Z-it),_=it-$,Z=n*pt,tt=Z-(Z-pt),nt=pt-tt,ut=_*nt-(ct-$*tt-_*tt-$*nt),rt=ot-ut,Y=ot-rt,F[0]=ot-(rt+Y)+(Y-ut),st=et+rt,Y=st-et,at=et-(st-Y)+(rt-Y),rt=at-ct,Y=at-rt,F[1]=at-(rt+Y)+(Y-ct),ft=st+rt,Y=ft-st,F[2]=st-(ft-Y)+(rt-Y),F[3]=ft,et=it*lt,Z=n*it,$=Z-(Z-it),_=it-$,Z=n*lt,tt=Z-(Z-lt),nt=lt-tt,ot=_*nt-(et-$*tt-_*tt-$*nt),ct=bt*Mt,Z=n*bt,$=Z-(Z-bt),_=bt-$,Z=n*Mt,tt=Z-(Z-Mt),nt=Mt-tt,ut=_*nt-(ct-$*tt-_*tt-$*nt),rt=ot-ut,Y=ot-rt,g[0]=ot-(rt+Y)+(Y-ut),st=et+rt,Y=st-et,at=et-(st-Y)+(rt-Y),rt=at-ct,Y=at-rt,g[1]=at-(rt+Y)+(Y-ct),ft=st+rt,Y=ft-st,g[2]=st-(ft-Y)+(rt-Y),g[3]=ft,E=s(s(e(4,A,xt,G),G,e(4,F,dt,H),H,I),I,e(4,g,wt,G),G,K);let yt=c(E,K),At=w*d;if(yt>=At||-yt>=At)return yt;if(Y=t-it,L=t-(it+Y)+(Y-l),Y=u-bt,Q=u-(bt+Y)+(Y-l),Y=b-ht,R=b-(ht+Y)+(Y-l),Y=a-Mt,S=a-(Mt+Y)+(Y-p),Y=f-lt,T=f-(lt+Y)+(Y-p),Y=h-pt,U=h-(pt+Y)+(Y-p),Y=o-xt,V=o-(xt+Y)+(Y-x),Y=i-dt,W=i-(dt+Y)+(Y-x),Y=M-wt,X=M-(wt+Y)+(Y-x),0===L&&0===Q&&0===R&&0===S&&0===T&&0===U&&0===V&&0===W&&0===X)return yt;if(At=y*d+r*Math.abs(yt),yt+=xt*(bt*U+pt*Q-(lt*R+ht*T))+V*(bt*pt-lt*ht)+dt*(ht*S+Mt*R-(pt*L+it*U))+W*(ht*Mt-pt*it)+wt*(it*T+lt*L-(Mt*Q+bt*S))+X*(it*lt-Mt*bt),yt>=At||-yt>=At)return yt;const Ft=O(L,S,bt,lt,ht,pt,j,k),gt=O(Q,T,ht,pt,it,Mt,m,q),jt=O(R,U,it,Mt,bt,lt,v,z),kt=s(gt,m,jt,z,B);E=N(E,e(kt,B,xt,I),I);const mt=s(jt,v,Ft,k,C);E=N(E,e(mt,C,dt,I),I);const qt=s(Ft,j,gt,q,D);return E=N(E,e(qt,D,wt,I),I),0!==V&&(E=N(E,e(4,A,V,J),J),E=N(E,e(kt,B,V,I),I)),0!==W&&(E=N(E,e(4,F,W,J),J),E=N(E,e(mt,C,W,I),I)),0!==X&&(E=N(E,e(4,g,X,J),J),E=N(E,e(qt,D,X,I),I)),0!==L&&(0!==T&&(E=P(E,L,T,wt,X)),0!==U&&(E=P(E,-L,U,dt,W))),0!==Q&&(0!==U&&(E=P(E,Q,U,xt,V)),0!==S&&(E=P(E,-Q,S,wt,X))),0!==R&&(0!==S&&(E=P(E,R,S,dt,W)),0!==T&&(E=P(E,-R,T,xt,V))),K[E-1]}(t,a,o,u,f,i,b,h,M,l,p,x,nt)}function R(t,n,r,s,a,e,o,c,u,f,i,b){const h=n-i,M=a-i,l=c-i,p=r-b,x=e-b,d=u-b;return(t-f)*(M*d-x*l)+(s-f)*(l*p-d*h)+(o-f)*(h*x-p*M)}const S=4440892098500632e-31,T=5423418723394464e-46,U=u(4),V=u(4),W=u(4),X=u(4),Y=u(4),Z=u(4),$=u(4),_=u(4),tt=u(8),nt=u(8),rt=u(8),st=u(8),at=u(8),et=u(8),ot=u(8),ct=u(8),ut=u(8),ft=u(4),it=u(4),bt=u(4),ht=u(8),Mt=u(16),lt=u(16),pt=u(16),xt=u(32),dt=u(32),wt=u(48),yt=u(64);let At=u(1152),Ft=u(1152);function gt(t,n,r){t=s(t,At,n,r,Ft);const a=At;return At=Ft,Ft=a,t}function jt(t,o,u,f,i,b,h,M){const l=t-h,p=u-h,x=i-h,d=o-M,w=f-M,y=b-M,A=p*y,F=x*w,g=l*l+d*d,j=x*d,k=l*y,m=p*p+w*w,q=l*w,v=p*d,z=x*x+y*y,B=g*(A-F)+m*(j-k)+z*(q-v),C=(Math.abs(A)+Math.abs(F))*g+(Math.abs(j)+Math.abs(k))*m+(Math.abs(q)+Math.abs(v))*z,D=11102230246251577e-31*C;return B>D||-B>D?B:function(t,o,u,f,i,b,h,M,l){let p,x,d,w,y,A,F,g,j,k,m,q,v,z,B,C,D,E,G,H,I,J,K,L,N,O,P,Q,R,Ft,jt,kt,mt,qt,vt;const zt=t-h,Bt=u-h,Ct=i-h,Dt=o-M,Et=f-M,Gt=b-M;jt=Bt*Gt,K=n*Bt,L=K-(K-Bt),N=Bt-L,K=n*Gt,O=K-(K-Gt),P=Gt-O,kt=N*P-(jt-L*O-N*O-L*P),mt=Ct*Et,K=n*Ct,L=K-(K-Ct),N=Ct-L,K=n*Et,O=K-(K-Et),P=Et-O,qt=N*P-(mt-L*O-N*O-L*P),Q=kt-qt,J=kt-Q,U[0]=kt-(Q+J)+(J-qt),R=jt+Q,J=R-jt,Ft=jt-(R-J)+(Q-J),Q=Ft-mt,J=Ft-Q,U[1]=Ft-(Q+J)+(J-mt),vt=R+Q,J=vt-R,U[2]=R-(vt-J)+(Q-J),U[3]=vt,jt=Ct*Dt,K=n*Ct,L=K-(K-Ct),N=Ct-L,K=n*Dt,O=K-(K-Dt),P=Dt-O,kt=N*P-(jt-L*O-N*O-L*P),mt=zt*Gt,K=n*zt,L=K-(K-zt),N=zt-L,K=n*Gt,O=K-(K-Gt),P=Gt-O,qt=N*P-(mt-L*O-N*O-L*P),Q=kt-qt,J=kt-Q,V[0]=kt-(Q+J)+(J-qt),R=jt+Q,J=R-jt,Ft=jt-(R-J)+(Q-J),Q=Ft-mt,J=Ft-Q,V[1]=Ft-(Q+J)+(J-mt),vt=R+Q,J=vt-R,V[2]=R-(vt-J)+(Q-J),V[3]=vt,jt=zt*Et,K=n*zt,L=K-(K-zt),N=zt-L,K=n*Et,O=K-(K-Et),P=Et-O,kt=N*P-(jt-L*O-N*O-L*P),mt=Bt*Dt,K=n*Bt,L=K-(K-Bt),N=Bt-L,K=n*Dt,O=K-(K-Dt),P=Dt-O,qt=N*P-(mt-L*O-N*O-L*P),Q=kt-qt,J=kt-Q,W[0]=kt-(Q+J)+(J-qt),R=jt+Q,J=R-jt,Ft=jt-(R-J)+(Q-J),Q=Ft-mt,J=Ft-Q,W[1]=Ft-(Q+J)+(J-mt),vt=R+Q,J=vt-R,W[2]=R-(vt-J)+(Q-J),W[3]=vt,p=s(s(s(e(e(4,U,zt,ht),ht,zt,Mt),Mt,e(e(4,U,Dt,ht),ht,Dt,lt),lt,xt),xt,s(e(e(4,V,Bt,ht),ht,Bt,Mt),Mt,e(e(4,V,Et,ht),ht,Et,lt),lt,dt),dt,yt),yt,s(e(e(4,W,Ct,ht),ht,Ct,Mt),Mt,e(e(4,W,Gt,ht),ht,Gt,lt),lt,xt),xt,At);let Ht=c(p,At),It=S*l;if(Ht>=It||-Ht>=It)return Ht;if(J=t-zt,x=t-(zt+J)+(J-h),J=o-Dt,y=o-(Dt+J)+(J-M),J=u-Bt,d=u-(Bt+J)+(J-h),J=f-Et,A=f-(Et+J)+(J-M),J=i-Ct,w=i-(Ct+J)+(J-h),J=b-Gt,F=b-(Gt+J)+(J-M),0===x&&0===d&&0===w&&0===y&&0===A&&0===F)return Ht;if(It=T*l+r*Math.abs(Ht),Ht+=(zt*zt+Dt*Dt)*(Bt*F+Gt*d-(Et*w+Ct*A))+2*(zt*x+Dt*y)*(Bt*Gt-Et*Ct)+((Bt*Bt+Et*Et)*(Ct*y+Dt*w-(Gt*x+zt*F))+2*(Bt*d+Et*A)*(Ct*Dt-Gt*zt))+((Ct*Ct+Gt*Gt)*(zt*A+Et*x-(Dt*d+Bt*y))+2*(Ct*w+Gt*F)*(zt*Et-Dt*Bt)),Ht>=It||-Ht>=It)return Ht;if(0===d&&0===A&&0===w&&0===F||(jt=zt*zt,K=n*zt,L=K-(K-zt),N=zt-L,kt=N*N-(jt-L*L-(L+L)*N),mt=Dt*Dt,K=n*Dt,L=K-(K-Dt),N=Dt-L,qt=N*N-(mt-L*L-(L+L)*N),Q=kt+qt,J=Q-kt,X[0]=kt-(Q-J)+(qt-J),R=jt+Q,J=R-jt,Ft=jt-(R-J)+(Q-J),Q=Ft+mt,J=Q-Ft,X[1]=Ft-(Q-J)+(mt-J),vt=R+Q,J=vt-R,X[2]=R-(vt-J)+(Q-J),X[3]=vt),0===w&&0===F&&0===x&&0===y||(jt=Bt*Bt,K=n*Bt,L=K-(K-Bt),N=Bt-L,kt=N*N-(jt-L*L-(L+L)*N),mt=Et*Et,K=n*Et,L=K-(K-Et),N=Et-L,qt=N*N-(mt-L*L-(L+L)*N),Q=kt+qt,J=Q-kt,Y[0]=kt-(Q-J)+(qt-J),R=jt+Q,J=R-jt,Ft=jt-(R-J)+(Q-J),Q=Ft+mt,J=Q-Ft,Y[1]=Ft-(Q-J)+(mt-J),vt=R+Q,J=vt-R,Y[2]=R-(vt-J)+(Q-J),Y[3]=vt),0===x&&0===y&&0===d&&0===A||(jt=Ct*Ct,K=n*Ct,L=K-(K-Ct),N=Ct-L,kt=N*N-(jt-L*L-(L+L)*N),mt=Gt*Gt,K=n*Gt,L=K-(K-Gt),N=Gt-L,qt=N*N-(mt-L*L-(L+L)*N),Q=kt+qt,J=Q-kt,Z[0]=kt-(Q-J)+(qt-J),R=jt+Q,J=R-jt,Ft=jt-(R-J)+(Q-J),Q=Ft+mt,J=Q-Ft,Z[1]=Ft-(Q-J)+(mt-J),vt=R+Q,J=vt-R,Z[2]=R-(vt-J)+(Q-J),Z[3]=vt),0!==x&&(g=e(4,U,x,tt),p=gt(p,a(e(g,tt,2*zt,Mt),Mt,e(e(4,Z,x,ht),ht,Et,lt),lt,e(e(4,Y,x,ht),ht,-Gt,pt),pt,xt,wt),wt)),0!==y&&(j=e(4,U,y,nt),p=gt(p,a(e(j,nt,2*Dt,Mt),Mt,e(e(4,Y,y,ht),ht,Ct,lt),lt,e(e(4,Z,y,ht),ht,-Bt,pt),pt,xt,wt),wt)),0!==d&&(k=e(4,V,d,rt),p=gt(p,a(e(k,rt,2*Bt,Mt),Mt,e(e(4,X,d,ht),ht,Gt,lt),lt,e(e(4,Z,d,ht),ht,-Dt,pt),pt,xt,wt),wt)),0!==A&&(m=e(4,V,A,st),p=gt(p,a(e(m,st,2*Et,Mt),Mt,e(e(4,Z,A,ht),ht,zt,lt),lt,e(e(4,X,A,ht),ht,-Ct,pt),pt,xt,wt),wt)),0!==w&&(q=e(4,W,w,at),p=gt(p,a(e(q,at,2*Ct,Mt),Mt,e(e(4,Y,w,ht),ht,Dt,lt),lt,e(e(4,X,w,ht),ht,-Et,pt),pt,xt,wt),wt)),0!==F&&(v=e(4,W,F,et),p=gt(p,a(e(v,et,2*Gt,Mt),Mt,e(e(4,X,F,ht),ht,Bt,lt),lt,e(e(4,Y,F,ht),ht,-zt,pt),pt,xt,wt),wt)),0!==x||0!==y){if(0!==d||0!==A||0!==w||0!==F?(jt=d*Gt,K=n*d,L=K-(K-d),N=d-L,K=n*Gt,O=K-(K-Gt),P=Gt-O,kt=N*P-(jt-L*O-N*O-L*P),mt=Bt*F,K=n*Bt,L=K-(K-Bt),N=Bt-L,K=n*F,O=K-(K-F),P=F-O,qt=N*P-(mt-L*O-N*O-L*P),Q=kt+qt,J=Q-kt,$[0]=kt-(Q-J)+(qt-J),R=jt+Q,J=R-jt,Ft=jt-(R-J)+(Q-J),Q=Ft+mt,J=Q-Ft,$[1]=Ft-(Q-J)+(mt-J),vt=R+Q,J=vt-R,$[2]=R-(vt-J)+(Q-J),$[3]=vt,jt=w*-Et,K=n*w,L=K-(K-w),N=w-L,K=n*-Et,O=K-(K- -Et),P=-Et-O,kt=N*P-(jt-L*O-N*O-L*P),mt=Ct*-A,K=n*Ct,L=K-(K-Ct),N=Ct-L,K=n*-A,O=K-(K- -A),P=-A-O,qt=N*P-(mt-L*O-N*O-L*P),Q=kt+qt,J=Q-kt,_[0]=kt-(Q-J)+(qt-J),R=jt+Q,J=R-jt,Ft=jt-(R-J)+(Q-J),Q=Ft+mt,J=Q-Ft,_[1]=Ft-(Q-J)+(mt-J),vt=R+Q,J=vt-R,_[2]=R-(vt-J)+(Q-J),_[3]=vt,B=s(4,$,4,_,ct),jt=d*F,K=n*d,L=K-(K-d),N=d-L,K=n*F,O=K-(K-F),P=F-O,kt=N*P-(jt-L*O-N*O-L*P),mt=w*A,K=n*w,L=K-(K-w),N=w-L,K=n*A,O=K-(K-A),P=A-O,qt=N*P-(mt-L*O-N*O-L*P),Q=kt-qt,J=kt-Q,it[0]=kt-(Q+J)+(J-qt),R=jt+Q,J=R-jt,Ft=jt-(R-J)+(Q-J),Q=Ft-mt,J=Ft-Q,it[1]=Ft-(Q+J)+(J-mt),vt=R+Q,J=vt-R,it[2]=R-(vt-J)+(Q-J),it[3]=vt,E=4):(ct[0]=0,B=1,it[0]=0,E=1),0!==x){const t=e(B,ct,x,pt);p=gt(p,s(e(g,tt,x,Mt),Mt,e(t,pt,2*zt,xt),xt,wt),wt);const n=e(E,it,x,ht);p=gt(p,a(e(n,ht,2*zt,Mt),Mt,e(n,ht,x,lt),lt,e(t,pt,x,xt),xt,dt,yt),yt),0!==A&&(p=gt(p,e(e(4,Z,x,ht),ht,A,Mt),Mt)),0!==F&&(p=gt(p,e(e(4,Y,-x,ht),ht,F,Mt),Mt))}if(0!==y){const t=e(B,ct,y,pt);p=gt(p,s(e(j,nt,y,Mt),Mt,e(t,pt,2*Dt,xt),xt,wt),wt);const n=e(E,it,y,ht);p=gt(p,a(e(n,ht,2*Dt,Mt),Mt,e(n,ht,y,lt),lt,e(t,pt,y,xt),xt,dt,yt),yt)}}if(0!==d||0!==A){if(0!==w||0!==F||0!==x||0!==y?(jt=w*Dt,K=n*w,L=K-(K-w),N=w-L,K=n*Dt,O=K-(K-Dt),P=Dt-O,kt=N*P-(jt-L*O-N*O-L*P),mt=Ct*y,K=n*Ct,L=K-(K-Ct),N=Ct-L,K=n*y,O=K-(K-y),P=y-O,qt=N*P-(mt-L*O-N*O-L*P),Q=kt+qt,J=Q-kt,$[0]=kt-(Q-J)+(qt-J),R=jt+Q,J=R-jt,Ft=jt-(R-J)+(Q-J),Q=Ft+mt,J=Q-Ft,$[1]=Ft-(Q-J)+(mt-J),vt=R+Q,J=vt-R,$[2]=R-(vt-J)+(Q-J),$[3]=vt,H=-Gt,I=-F,jt=x*H,K=n*x,L=K-(K-x),N=x-L,K=n*H,O=K-(K-H),P=H-O,kt=N*P-(jt-L*O-N*O-L*P),mt=zt*I,K=n*zt,L=K-(K-zt),N=zt-L,K=n*I,O=K-(K-I),P=I-O,qt=N*P-(mt-L*O-N*O-L*P),Q=kt+qt,J=Q-kt,_[0]=kt-(Q-J)+(qt-J),R=jt+Q,J=R-jt,Ft=jt-(R-J)+(Q-J),Q=Ft+mt,J=Q-Ft,_[1]=Ft-(Q-J)+(mt-J),vt=R+Q,J=vt-R,_[2]=R-(vt-J)+(Q-J),_[3]=vt,C=s(4,$,4,_,ut),jt=w*y,K=n*w,L=K-(K-w),N=w-L,K=n*y,O=K-(K-y),P=y-O,kt=N*P-(jt-L*O-N*O-L*P),mt=x*F,K=n*x,L=K-(K-x),N=x-L,K=n*F,O=K-(K-F),P=F-O,qt=N*P-(mt-L*O-N*O-L*P),Q=kt-qt,J=kt-Q,bt[0]=kt-(Q+J)+(J-qt),R=jt+Q,J=R-jt,Ft=jt-(R-J)+(Q-J),Q=Ft-mt,J=Ft-Q,bt[1]=Ft-(Q+J)+(J-mt),vt=R+Q,J=vt-R,bt[2]=R-(vt-J)+(Q-J),bt[3]=vt,G=4):(ut[0]=0,C=1,bt[0]=0,G=1),0!==d){const t=e(C,ut,d,pt);p=gt(p,s(e(k,rt,d,Mt),Mt,e(t,pt,2*Bt,xt),xt,wt),wt);const n=e(G,bt,d,ht);p=gt(p,a(e(n,ht,2*Bt,Mt),Mt,e(n,ht,d,lt),lt,e(t,pt,d,xt),xt,dt,yt),yt),0!==F&&(p=gt(p,e(e(4,X,d,ht),ht,F,Mt),Mt)),0!==y&&(p=gt(p,e(e(4,Z,-d,ht),ht,y,Mt),Mt))}if(0!==A){const t=e(C,ut,A,pt);p=gt(p,s(e(m,st,A,Mt),Mt,e(t,pt,2*Et,xt),xt,wt),wt);const n=e(G,bt,A,ht);p=gt(p,a(e(n,ht,2*Et,Mt),Mt,e(n,ht,A,lt),lt,e(t,pt,A,xt),xt,dt,yt),yt)}}if(0!==w||0!==F){if(0!==x||0!==y||0!==d||0!==A?(jt=x*Et,K=n*x,L=K-(K-x),N=x-L,K=n*Et,O=K-(K-Et),P=Et-O,kt=N*P-(jt-L*O-N*O-L*P),mt=zt*A,K=n*zt,L=K-(K-zt),N=zt-L,K=n*A,O=K-(K-A),P=A-O,qt=N*P-(mt-L*O-N*O-L*P),Q=kt+qt,J=Q-kt,$[0]=kt-(Q-J)+(qt-J),R=jt+Q,J=R-jt,Ft=jt-(R-J)+(Q-J),Q=Ft+mt,J=Q-Ft,$[1]=Ft-(Q-J)+(mt-J),vt=R+Q,J=vt-R,$[2]=R-(vt-J)+(Q-J),$[3]=vt,H=-Dt,I=-y,jt=d*H,K=n*d,L=K-(K-d),N=d-L,K=n*H,O=K-(K-H),P=H-O,kt=N*P-(jt-L*O-N*O-L*P),mt=Bt*I,K=n*Bt,L=K-(K-Bt),N=Bt-L,K=n*I,O=K-(K-I),P=I-O,qt=N*P-(mt-L*O-N*O-L*P),Q=kt+qt,J=Q-kt,_[0]=kt-(Q-J)+(qt-J),R=jt+Q,J=R-jt,Ft=jt-(R-J)+(Q-J),Q=Ft+mt,J=Q-Ft,_[1]=Ft-(Q-J)+(mt-J),vt=R+Q,J=vt-R,_[2]=R-(vt-J)+(Q-J),_[3]=vt,z=s(4,$,4,_,ot),jt=x*A,K=n*x,L=K-(K-x),N=x-L,K=n*A,O=K-(K-A),P=A-O,kt=N*P-(jt-L*O-N*O-L*P),mt=d*y,K=n*d,L=K-(K-d),N=d-L,K=n*y,O=K-(K-y),P=y-O,qt=N*P-(mt-L*O-N*O-L*P),Q=kt-qt,J=kt-Q,ft[0]=kt-(Q+J)+(J-qt),R=jt+Q,J=R-jt,Ft=jt-(R-J)+(Q-J),Q=Ft-mt,J=Ft-Q,ft[1]=Ft-(Q+J)+(J-mt),vt=R+Q,J=vt-R,ft[2]=R-(vt-J)+(Q-J),ft[3]=vt,D=4):(ot[0]=0,z=1,ft[0]=0,D=1),0!==w){const t=e(z,ot,w,pt);p=gt(p,s(e(q,at,w,Mt),Mt,e(t,pt,2*Ct,xt),xt,wt),wt);const n=e(D,ft,w,ht);p=gt(p,a(e(n,ht,2*Ct,Mt),Mt,e(n,ht,w,lt),lt,e(t,pt,w,xt),xt,dt,yt),yt),0!==y&&(p=gt(p,e(e(4,Y,w,ht),ht,y,Mt),Mt)),0!==A&&(p=gt(p,e(e(4,X,-w,ht),ht,A,Mt),Mt))}if(0!==F){const t=e(z,ot,F,pt);p=gt(p,s(e(v,et,F,Mt),Mt,e(t,pt,2*Gt,xt),xt,wt),wt);const n=e(D,ft,F,ht);p=gt(p,a(e(n,ht,2*Gt,Mt),Mt,e(n,ht,F,lt),lt,e(t,pt,F,xt),xt,dt,yt),yt)}}return At[p-1]}(t,o,u,f,i,b,h,M,C)}function kt(t,n,r,s,a,e,o,c){const u=t-o,f=n-c,i=r-o,b=s-c,h=a-o,M=e-c;return(u*u+f*f)*(i*M-h*b)+(i*i+b*b)*(h*f-u*M)+(h*h+M*M)*(u*b-i*f)}const mt=5551115123125792e-31,qt=8751425667295619e-46,vt=u(4),zt=u(4),Bt=u(4),Ct=u(4),Dt=u(4),Et=u(4),Gt=u(4),Ht=u(4),It=u(4),Jt=u(4),Kt=u(24),Lt=u(24),Nt=u(24),Ot=u(24),Pt=u(24),Qt=u(24),Rt=u(24),St=u(24),Tt=u(24),Ut=u(24),Vt=u(1152),Wt=u(1152),Xt=u(1152),Yt=u(1152),Zt=u(1152),$t=u(2304),_t=u(2304),tn=u(3456),nn=u(5760),rn=u(8),sn=u(8),an=u(8),en=u(16),on=u(24),cn=u(48),un=u(48),fn=u(96),bn=u(192),hn=u(384),Mn=u(384),ln=u(384),pn=u(768);function xn(t,n,r,s,o,c,u){return a(e(4,t,s,rn),rn,e(4,n,o,sn),sn,e(4,r,c,an),an,en,u)}function dn(t,n,r,c,u,f,i,b,h,M,l,p){const x=s(s(t,n,r,c,cn),cn,o(s(u,f,i,b,un),un),un,fn);return a(e(e(x,fn,h,bn),bn,h,hn),hn,e(e(x,fn,M,bn),bn,M,Mn),Mn,e(e(x,fn,l,bn),bn,l,ln),ln,pn,p)}const wn=u(96),yn=u(96),An=u(96),Fn=u(1152);function gn(t,n,r,s,o,c,u,f,i,b){const h=xn(t,n,r,s,o,c,on);return a(e(e(h,on,u,cn),cn,u,wn),wn,e(e(h,on,f,cn),cn,f,yn),yn,e(e(h,on,i,cn),cn,i,An),An,bn,b)}function jn(t,e,u,f,i,b,h,M,l,p,x,d,w,y,A,F){let g,j,k,m,q,v,z,B,C,D,E,G,H,I,J,K,L,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$;const _=t-w,tt=f-w,nt=h-w,rt=p-w,st=e-y,at=i-y,et=M-y,ot=x-y,ct=u-A,ut=b-A,ft=l-A,it=d-A;X=_*at,P=n*_,Q=P-(P-_),R=_-Q,P=n*at,S=P-(P-at),T=at-S,Y=R*T-(X-Q*S-R*S-Q*T),Z=tt*st,P=n*tt,Q=P-(P-tt),R=tt-Q,P=n*st,S=P-(P-st),T=st-S,$=R*T-(Z-Q*S-R*S-Q*T),U=Y-$,O=Y-U,vt[0]=Y-(U+O)+(O-$),V=X+U,O=V-X,W=X-(V-O)+(U-O),U=W-Z,O=W-U,vt[1]=W-(U+O)+(O-Z),g=V+U,O=g-V,vt[2]=V-(g-O)+(U-O),vt[3]=g,X=tt*et,P=n*tt,Q=P-(P-tt),R=tt-Q,P=n*et,S=P-(P-et),T=et-S,Y=R*T-(X-Q*S-R*S-Q*T),Z=nt*at,P=n*nt,Q=P-(P-nt),R=nt-Q,P=n*at,S=P-(P-at),T=at-S,$=R*T-(Z-Q*S-R*S-Q*T),U=Y-$,O=Y-U,zt[0]=Y-(U+O)+(O-$),V=X+U,O=V-X,W=X-(V-O)+(U-O),U=W-Z,O=W-U,zt[1]=W-(U+O)+(O-Z),j=V+U,O=j-V,zt[2]=V-(j-O)+(U-O),zt[3]=j,X=nt*ot,P=n*nt,Q=P-(P-nt),R=nt-Q,P=n*ot,S=P-(P-ot),T=ot-S,Y=R*T-(X-Q*S-R*S-Q*T),Z=rt*et,P=n*rt,Q=P-(P-rt),R=rt-Q,P=n*et,S=P-(P-et),T=et-S,$=R*T-(Z-Q*S-R*S-Q*T),U=Y-$,O=Y-U,Bt[0]=Y-(U+O)+(O-$),V=X+U,O=V-X,W=X-(V-O)+(U-O),U=W-Z,O=W-U,Bt[1]=W-(U+O)+(O-Z),k=V+U,O=k-V,Bt[2]=V-(k-O)+(U-O),Bt[3]=k,X=rt*st,P=n*rt,Q=P-(P-rt),R=rt-Q,P=n*st,S=P-(P-st),T=st-S,Y=R*T-(X-Q*S-R*S-Q*T),Z=_*ot,P=n*_,Q=P-(P-_),R=_-Q,P=n*ot,S=P-(P-ot),T=ot-S,$=R*T-(Z-Q*S-R*S-Q*T),U=Y-$,O=Y-U,It[0]=Y-(U+O)+(O-$),V=X+U,O=V-X,W=X-(V-O)+(U-O),U=W-Z,O=W-U,It[1]=W-(U+O)+(O-Z),m=V+U,O=m-V,It[2]=V-(m-O)+(U-O),It[3]=m,X=_*et,P=n*_,Q=P-(P-_),R=_-Q,P=n*et,S=P-(P-et),T=et-S,Y=R*T-(X-Q*S-R*S-Q*T),Z=nt*st,P=n*nt,Q=P-(P-nt),R=nt-Q,P=n*st,S=P-(P-st),T=st-S,$=R*T-(Z-Q*S-R*S-Q*T),U=Y-$,O=Y-U,Et[0]=Y-(U+O)+(O-$),V=X+U,O=V-X,W=X-(V-O)+(U-O),U=W-Z,O=W-U,Et[1]=W-(U+O)+(O-Z),q=V+U,O=q-V,Et[2]=V-(q-O)+(U-O),Et[3]=q,X=tt*ot,P=n*tt,Q=P-(P-tt),R=tt-Q,P=n*ot,S=P-(P-ot),T=ot-S,Y=R*T-(X-Q*S-R*S-Q*T),Z=rt*at,P=n*rt,Q=P-(P-rt),R=rt-Q,P=n*at,S=P-(P-at),T=at-S,$=R*T-(Z-Q*S-R*S-Q*T),U=Y-$,O=Y-U,Gt[0]=Y-(U+O)+(O-$),V=X+U,O=V-X,W=X-(V-O)+(U-O),U=W-Z,O=W-U,Gt[1]=W-(U+O)+(O-Z),v=V+U,O=v-V,Gt[2]=V-(v-O)+(U-O),Gt[3]=v;let bt=c(s(s(o(gn(zt,Bt,Gt,it,ut,-ft,_,st,ct,Vt),Vt),Vt,gn(Bt,It,Et,ct,ft,it,tt,at,ut,Wt),Wt,$t),$t,s(o(gn(It,vt,Gt,ut,it,ct,nt,et,ft,Xt),Xt),Xt,gn(vt,zt,Et,ft,ct,-ut,rt,ot,it,Yt),Yt,_t),_t,Fn),Fn),ht=mt*F;if(bt>=ht||-bt>=ht)return bt;if(O=t-_,z=t-(_+O)+(O-w),O=e-st,E=e-(st+O)+(O-y),O=u-ct,J=u-(ct+O)+(O-A),O=f-tt,B=f-(tt+O)+(O-w),O=i-at,G=i-(at+O)+(O-y),O=b-ut,K=b-(ut+O)+(O-A),O=h-nt,C=h-(nt+O)+(O-w),O=M-et,H=M-(et+O)+(O-y),O=l-ft,L=l-(ft+O)+(O-A),O=p-rt,D=p-(rt+O)+(O-w),O=x-ot,I=x-(ot+O)+(O-y),O=d-it,N=d-(it+O)+(O-A),0===z&&0===E&&0===J&&0===B&&0===G&&0===K&&0===C&&0===H&&0===L&&0===D&&0===I&&0===N)return bt;ht=qt*F+r*Math.abs(bt);const Mt=_*G+at*z-(st*B+tt*E),lt=tt*H+et*B-(at*C+nt*G),pt=nt*I+ot*C-(et*D+rt*H),xt=rt*E+st*D-(ot*z+_*I),dt=_*H+et*z-(st*C+nt*E),wt=tt*I+ot*B-(at*D+rt*G);return bt+=(tt*tt+at*at+ut*ut)*(ft*xt+it*dt+ct*pt+(L*m+N*q+J*k))+(rt*rt+ot*ot+it*it)*(ct*lt-ut*dt+ft*Mt+(J*j-K*q+L*g))-((_*_+st*st+ct*ct)*(ut*pt-ft*wt+it*lt+(K*k-L*v+N*j))+(nt*nt+et*et+ft*ft)*(it*Mt+ct*wt+ut*xt+(N*g+J*v+K*m)))+2*((tt*B+at*G+ut*K)*(ft*m+it*q+ct*k)+(rt*D+ot*I+it*N)*(ct*j-ut*q+ft*g)-((_*z+st*E+ct*J)*(ut*k-ft*v+it*j)+(nt*C+et*H+ft*L)*(it*g+ct*v+ut*m))),bt>=ht||-bt>=ht?bt:function(t,r,s,e,o,c,u,f,i,b,h,M,l,p,x){let d,w,y,A,F,g,j,k,m,q,v,z,B,C;q=t*o,w=n*t,y=w-(w-t),A=t-y,w=n*o,F=w-(w-o),g=o-F,v=A*g-(q-y*F-A*F-y*g),z=e*r,w=n*e,y=w-(w-e),A=e-y,w=n*r,F=w-(w-r),g=r-F,B=A*g-(z-y*F-A*F-y*g),j=v-B,d=v-j,vt[0]=v-(j+d)+(d-B),k=q+j,d=k-q,m=q-(k-d)+(j-d),j=m-z,d=m-j,vt[1]=m-(j+d)+(d-z),C=k+j,d=C-k,vt[2]=k-(C-d)+(j-d),vt[3]=C,q=e*f,w=n*e,y=w-(w-e),A=e-y,w=n*f,F=w-(w-f),g=f-F,v=A*g-(q-y*F-A*F-y*g),z=u*o,w=n*u,y=w-(w-u),A=u-y,w=n*o,F=w-(w-o),g=o-F,B=A*g-(z-y*F-A*F-y*g),j=v-B,d=v-j,zt[0]=v-(j+d)+(d-B),k=q+j,d=k-q,m=q-(k-d)+(j-d),j=m-z,d=m-j,zt[1]=m-(j+d)+(d-z),C=k+j,d=C-k,zt[2]=k-(C-d)+(j-d),zt[3]=C,q=u*h,w=n*u,y=w-(w-u),A=u-y,w=n*h,F=w-(w-h),g=h-F,v=A*g-(q-y*F-A*F-y*g),z=b*f,w=n*b,y=w-(w-b),A=b-y,w=n*f,F=w-(w-f),g=f-F,B=A*g-(z-y*F-A*F-y*g),j=v-B,d=v-j,Bt[0]=v-(j+d)+(d-B),k=q+j,d=k-q,m=q-(k-d)+(j-d),j=m-z,d=m-j,Bt[1]=m-(j+d)+(d-z),C=k+j,d=C-k,Bt[2]=k-(C-d)+(j-d),Bt[3]=C,q=b*p,w=n*b,y=w-(w-b),A=b-y,w=n*p,F=w-(w-p),g=p-F,v=A*g-(q-y*F-A*F-y*g),z=l*h,w=n*l,y=w-(w-l),A=l-y,w=n*h,F=w-(w-h),g=h-F,B=A*g-(z-y*F-A*F-y*g),j=v-B,d=v-j,Ct[0]=v-(j+d)+(d-B),k=q+j,d=k-q,m=q-(k-d)+(j-d),j=m-z,d=m-j,Ct[1]=m-(j+d)+(d-z),C=k+j,d=C-k,Ct[2]=k-(C-d)+(j-d),Ct[3]=C,q=l*r,w=n*l,y=w-(w-l),A=l-y,w=n*r,F=w-(w-r),g=r-F,v=A*g-(q-y*F-A*F-y*g),z=t*p,w=n*t,y=w-(w-t),A=t-y,w=n*p,F=w-(w-p),g=p-F,B=A*g-(z-y*F-A*F-y*g),j=v-B,d=v-j,Dt[0]=v-(j+d)+(d-B),k=q+j,d=k-q,m=q-(k-d)+(j-d),j=m-z,d=m-j,Dt[1]=m-(j+d)+(d-z),C=k+j,d=C-k,Dt[2]=k-(C-d)+(j-d),Dt[3]=C,q=t*f,w=n*t,y=w-(w-t),A=t-y,w=n*f,F=w-(w-f),g=f-F,v=A*g-(q-y*F-A*F-y*g),z=u*r,w=n*u,y=w-(w-u),A=u-y,w=n*r,F=w-(w-r),g=r-F,B=A*g-(z-y*F-A*F-y*g),j=v-B,d=v-j,Et[0]=v-(j+d)+(d-B),k=q+j,d=k-q,m=q-(k-d)+(j-d),j=m-z,d=m-j,Et[1]=m-(j+d)+(d-z),C=k+j,d=C-k,Et[2]=k-(C-d)+(j-d),Et[3]=C,q=e*h,w=n*e,y=w-(w-e),A=e-y,w=n*h,F=w-(w-h),g=h-F,v=A*g-(q-y*F-A*F-y*g),z=b*o,w=n*b,y=w-(w-b),A=b-y,w=n*o,F=w-(w-o),g=o-F,B=A*g-(z-y*F-A*F-y*g),j=v-B,d=v-j,Gt[0]=v-(j+d)+(d-B),k=q+j,d=k-q,m=q-(k-d)+(j-d),j=m-z,d=m-j,Gt[1]=m-(j+d)+(d-z),C=k+j,d=C-k,Gt[2]=k-(C-d)+(j-d),Gt[3]=C,q=u*p,w=n*u,y=w-(w-u),A=u-y,w=n*p,F=w-(w-p),g=p-F,v=A*g-(q-y*F-A*F-y*g),z=l*f,w=n*l,y=w-(w-l),A=l-y,w=n*f,F=w-(w-f),g=f-F,B=A*g-(z-y*F-A*F-y*g),j=v-B,d=v-j,Ht[0]=v-(j+d)+(d-B),k=q+j,d=k-q,m=q-(k-d)+(j-d),j=m-z,d=m-j,Ht[1]=m-(j+d)+(d-z),C=k+j,d=C-k,Ht[2]=k-(C-d)+(j-d),Ht[3]=C,q=b*r,w=n*b,y=w-(w-b),A=b-y,w=n*r,F=w-(w-r),g=r-F,v=A*g-(q-y*F-A*F-y*g),z=t*h,w=n*t,y=w-(w-t),A=t-y,w=n*h,F=w-(w-h),g=h-F,B=A*g-(z-y*F-A*F-y*g),j=v-B,d=v-j,It[0]=v-(j+d)+(d-B),k=q+j,d=k-q,m=q-(k-d)+(j-d),j=m-z,d=m-j,It[1]=m-(j+d)+(d-z),C=k+j,d=C-k,It[2]=k-(C-d)+(j-d),It[3]=C,q=l*o,w=n*l,y=w-(w-l),A=l-y,w=n*o,F=w-(w-o),g=o-F,v=A*g-(q-y*F-A*F-y*g),z=e*p,w=n*e,y=w-(w-e),A=e-y,w=n*p,F=w-(w-p),g=p-F,B=A*g-(z-y*F-A*F-y*g),j=v-B,d=v-j,Jt[0]=v-(j+d)+(d-B),k=q+j,d=k-q,m=q-(k-d)+(j-d),j=m-z,d=m-j,Jt[1]=m-(j+d)+(d-z),C=k+j,d=C-k,Jt[2]=k-(C-d)+(j-d),Jt[3]=C;const D=xn(vt,zt,Et,i,s,-c,Kt),E=xn(zt,Bt,Gt,M,c,-i,Lt),G=xn(Bt,Ct,Ht,x,i,-M,Nt),H=xn(Ct,Dt,It,s,M,-x,Ot),I=xn(Dt,vt,Jt,c,x,-s,Pt),J=xn(vt,Gt,It,M,s,c,Qt),K=xn(zt,Ht,Jt,x,c,i,Rt),L=xn(Bt,It,Et,s,i,M,St),N=xn(Ct,Jt,Gt,c,M,x,Tt),O=xn(Dt,Et,Ht,i,x,s,Ut),P=a(dn(G,Nt,K,Rt,N,Tt,E,Lt,t,r,s,Vt),Vt,dn(H,Ot,L,St,O,Ut,G,Nt,e,o,c,Wt),Wt,a(dn(I,Pt,N,Tt,J,Qt,H,Ot,u,f,i,Xt),Xt,dn(D,Kt,O,Ut,K,Rt,I,Pt,b,h,M,Yt),Yt,dn(E,Lt,J,Qt,L,St,D,Kt,l,p,x,Zt),Zt,_t,tn),tn,$t,nn);return nn[P-1]}(t,e,u,f,i,b,h,M,l,p,x,d,w,y,A)}function kn(t,n,r,s,a,e,o,c,u,f,i,b,h,M,l){const p=t-h,x=s-h,d=o-h,w=f-h,y=n-M,A=a-M,F=c-M,g=i-M,j=r-l,k=e-l,m=u-l,q=b-l,v=p*A,z=x*y,B=v-z,C=x*F,D=d*A,E=C-D,G=d*g,H=w*F,I=G-H,J=w*y,K=p*g,L=J-K,N=p*F,O=d*y,P=N-O,Q=x*g,R=w*A,S=Q-R,T=p*p+y*y+j*j,U=x*x+A*A+k*k,V=d*d+F*F+m*m,W=w*w+g*g+q*q,X=V*(q*B+j*S+k*L)-W*(j*E-k*P+m*B)+(T*(k*I-m*S+q*E)-U*(m*L+q*P+j*I)),Y=Math.abs(j),Z=Math.abs(k),$=Math.abs(m),_=Math.abs(q),tt=Math.abs(v)+Math.abs(z),nt=Math.abs(C)+Math.abs(D),rt=Math.abs(G)+Math.abs(H),st=Math.abs(J)+Math.abs(K),at=Math.abs(N)+Math.abs(O),et=Math.abs(Q)+Math.abs(R),ot=(rt*Z+et*$+nt*_)*T+(st*$+at*_+rt*Y)*U+(tt*_+et*Y+st*Z)*V+(nt*Y+at*Z+tt*$)*W,ct=17763568394002532e-31*ot;return X>ct||-X>ct?X:-jn(t,n,r,s,a,e,o,c,u,f,i,b,h,M,l,ot)}function mn(t,n,r,s,a,e,o,c,u,f,i,b,h,M,l){const p=t-h,x=s-h,d=o-h,w=f-h,y=n-M,A=a-M,F=c-M,g=i-M,j=r-l,k=e-l,m=u-l,q=b-l,v=p*A-x*y,z=x*F-d*A,B=d*g-w*F,C=w*y-p*g,D=p*F-d*y,E=x*g-w*A;return(d*d+F*F+m*m)*(q*v+j*E+k*C)-(w*w+g*g+q*q)*(j*z-k*D+m*v)+((p*p+y*y+j*j)*(k*B-m*E+q*z)-(x*x+A*A+k*k)*(m*C+q*D+j*B))}export{jt as incircle,kt as incirclefast,kn as insphere,mn as inspherefast,x as orient2d,d as orient2dfast,Q as orient3d,R as orient3dfast};export default null; diff --git a/datavis-survey.html b/datavis-survey.html index 4fe3ec4..aa6a4ae 100644 --- a/datavis-survey.html +++ b/datavis-survey.html @@ -12,17 +12,25 @@ - + + + + + + + + + + + - - @@ -32,53 +40,125 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -238,48 +374,8 @@
- + +
- -

Latent Scope: Plot Issues & Pull Requests

-

Source data. Generated with Latent Scope

-
- +

Survey Analysis Example

+ +

A common source of valuable unstructured text data is the free response questions often asked in surveys. This data is of course difficult to work with, as typical techniques for finding insights in surveys focus on structured data like the answers to multiple choice questions.

+

The data used to setup your first scope is in fact the 765 responses to the question: +"What do you think people you work with just don't get about the data visualization work that you do?"

+

Let's take a look at how Latent Scope can help us pull out some insight from those responses by examining the clusters it's identified. Note that this page is using the exported scope from the your first scope guide, and much of this analysis could be done within the tool.

+

Before we get to the fun visualizations, let's take a look at the input data. The data is an extract of the full survey, where the answer to the question is stored in DataVizNotUnderstood, and we also have multiple-choice answer of the respondant's Role along with how many years of data visualization experience they have in YearsDataVizExperience:

+
+ +
+

As you can see, it's not very straightforward to pick out patterns just by scrolling through the text, so let's take a look at what Latent Scope gave us:

+
+
+ +
+
+ +
+
+ +
+

+
+
+
points. - points . + points selected.
- +
-
+
+
+ +
+

The map is created by going through the 4 step process in Latent scope:

+
    +
  1. Embed - run each piece of text through an embedding model
  2. +
  3. Project - run the high-dimensional embeddings through UMAP
  4. +
  5. Cluster - run the 2-dimensional UMAP coordinates through HDBSCAN
  6. +
  7. Label - ask an LLM to create a label by summarizing a list of text taken from each cluster
  8. +
+

What the process gives us is a workable categorization of the text data based on the patterns captured by the embedding model and the labeling of the LLM. +Of course these automated steps are never perfect, so Latent Scope is designed to both let you tweak the parameters of each step as well as manually re-categorize data once the process is finished. For more details see the explore and curate guide.

+

Let's take a closer look at some of the clusters we got, starting with my favorite (because it's so true!)

+
+ +
+

As I mentioned, the process isn't perfect, and here we see a cluster that could have easily been combined with Cluster 27:

+
+ +
+

In fact, I did use the explore tool to combine a couple of clusters into this one:

+
+ +
+

And we can see that how much time it takes to make data visualizations is a common response, there is this other large cluster:

+
+ +
+

As you can see, the embeddings (and UMAP, and clustering) may separate text based on different concepts. The last two clusters are conceptually very similar with the main difference being that most people used the word "viz" in one cluster and not in the other. I find it quite amazing that this level of separation is possible, but it may sometimes not be what you want to separate.

+

The theme of time and effort is expressed further in other clusters:

+
+ +
+
+ +
+
+ +
+

Whew! Data visualization certainly takes a lot of time and effort! There are many more clusters to explore ( in fact), instead of listing them all out let's end with a little interactive choice:

+
- +
-
-
-
-
-
-
-
-
-
-
+

What are you waiting for? Try Latent Scope out on your own data!

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/explore-and-curate.html b/explore-and-curate.html index c33d26c..0d8ba4b 100644 --- a/explore-and-curate.html +++ b/explore-and-curate.html @@ -63,48 +63,8 @@
- +
diff --git a/exporting-data.html b/exporting-data.html index be3fcab..b966683 100644 --- a/exporting-data.html +++ b/exporting-data.html @@ -26,7 +26,7 @@ import {define} from "./_observablehq/client.js"; import {registerFile} from "./_observablehq/stdlib.js"; -registerFile("./data/plot-issues/scopes-001.parquet", {"name":"./data/plot-issues/scopes-001.parquet","path":"./_file/data/plot-issues/scopes-001.1a92c7da.parquet","lastModified":1713964366103}); +registerFile("./data/plot-issues/scopes-001.parquet", {"name":"./data/plot-issues/scopes-001.parquet","path":"./data/plot-issues/scopes-001.parquet"}); define({id: "258713ac", inputs: ["DuckDBClient","FileAttachment"], outputs: ["db"], body: (DuckDBClient,FileAttachment) => { const db = DuckDBClient.of({ @@ -89,48 +89,8 @@
- +
diff --git a/index.html b/index.html index 292711f..8d7c667 100644 --- a/index.html +++ b/index.html @@ -45,48 +45,8 @@
- +
diff --git a/install-and-config.html b/install-and-config.html index bb68e7a..95465d1 100644 --- a/install-and-config.html +++ b/install-and-config.html @@ -54,48 +54,8 @@
- +
diff --git a/plot-issues.html b/plot-issues.html index 03093c3..26c0610 100644 --- a/plot-issues.html +++ b/plot-issues.html @@ -12,7 +12,7 @@ - + @@ -21,9 +21,9 @@ - + @@ -39,79 +39,48 @@ import {define} from "./_observablehq/client.js"; import {registerFile} from "./_observablehq/stdlib.js"; -registerFile("./data/plot-issues/input.parquet", {"name":"./data/plot-issues/input.parquet","path":"./_file/data/plot-issues/input.e0f83d2a.parquet","lastModified":1709668909612}); -registerFile("./data/plot-issues/scopes-001.parquet", {"name":"./data/plot-issues/scopes-001.parquet","path":"./_file/data/plot-issues/scopes-001.1a92c7da.parquet","lastModified":1713964366103}); +registerFile("./data/plot-issues/input.parquet", {"name":"./data/plot-issues/input.parquet","path":"./data/plot-issues/input.parquet"}); +registerFile("./data/plot-issues/scopes-001.parquet", {"name":"./data/plot-issues/scopes-001.parquet","path":"./data/plot-issues/scopes-001.parquet"}); -define({id: "b56a2c7c", inline: true, inputs: ["resize","scatter","data","canvas","display"], body: async (resize,scatter,data,canvas,display) => { +define({id: "1f167906", inline: true, inputs: ["resize","scatter","data","canvas","display"], body: async (resize,scatter,data,canvas,display) => { display(await( resize((width) => scatter(data.toArray(), { - canvas, - width, - height: 500, - color: (d) => d.cluster - //color: (d) => d.raw_cluster - })) + canvas, + width, + height: 500, + pointSize: 5, + color: (d) => d.cluster + })) )) }}); -define({id: "46313d53", inline: true, inputs: ["data","display"], body: async (data,display) => { +define({id: "f67d1c0a", inline: true, inputs: ["hull","hulls","map","display"], body: async (hull,hulls,map,display) => { display(await( -data.toArray().length +hull(hulls, { + width: map.width, + height: map.height, + xd: map.xd, + yd: map.yd + }) + )) }}); -define({id: "14be7f3c", inline: true, inputs: ["display","selected"], body: (display,selected) => { -display(selected.length) -}}); - -define({id: "b6999918", inline: true, inputs: ["selected","display"], body: async (selected,display) => { +define({id: "8d266656", inline: true, inputs: ["hp","hull","hulls","map","display"], body: async (hp,hull,hulls,map,display) => { display(await( -selected.length == 1 ? "hovered" : "selected" +hp ? hull([hulls[hp.cluster]], { + fill: "rgba(20,20,20,0.25)", + width: map.width, + height: map.height, + xd: map.xd, + yd: map.yd + }) : "" )) }}); -define({id: "c4a24530", inline: true, inputs: ["selected","display"], body: async (selected,display) => { +define({id: "97380187", inline: true, inputs: ["tip","display"], body: async (tip,display) => { display(await( -!selected.length ? "Hold shift + drag to select multiple points.":"" -)) -}}); - -define({id: "ca638f0b", inline: true, inputs: ["selected","Inputs","canvas","display"], body: async (selected,Inputs,canvas,display) => { -display(await( - selected.length > 1 ? Inputs.button("Deselect", { - value: null, - reduce: () => canvas.scatter.select([]) - }) : "" - -)) -}}); - -define({id: "87615f11", inline: true, inputs: ["selected","Inputs","tableData","htl","display"], body: async (selected,Inputs,tableData,htl,display) => { -display(await( -selected.length == 1 ? Inputs.table([tableData[selected[0]]], { - columns: [ - "title", "body", - "state", - "created_at", - "closed_at", - "label", - "cluster" - ], - width: { - "title": 250, - "state": 40, - "label": 250, - "cluster": 40 - }, - rows: 1 - }) : htl.html`
` - -)) -}}); - -define({id: "0d4fc4a7", inline: true, inputs: ["table","display"], body: async (table,display) => { -display(await( -table +tip )) }}); @@ -120,10 +89,8 @@ return {selected}; }}); -define({id: "c48adcf3", outputs: ["canvas"], body: () => { -// TODO: this recreates the canvas +define({id: "77f718ba", outputs: ["canvas"], body: () => { const canvas = document.createElement("canvas") -canvas.value = [] return {canvas}; }}); @@ -209,7 +176,7 @@ }}); define({id: "0e0057e1", outputs: ["scatter"], body: async () => { -const {scatter} = await import("./_import/components/scatter.8e757dc8.js"); +const {scatter} = await import("./_import/components/scatter.e6a504c8.js"); return {scatter}; }}); @@ -249,48 +216,8 @@
- +
@@ -311,22 +238,20 @@

Latent Scope: Plot Issues & Pull Requests

Source data. Generated with Latent Scope

-
- -
-
- points. - points . -
- +
+
+
- -
-
- +
+ +
+
+ +
+

-
+
@@ -338,6 +263,6 @@

-
Built with Observable on May 1, 2024.
+
Built with Observable on May 3, 2024.

diff --git a/us-federal-laws.html b/us-federal-laws.html index 3c73221..662c303 100644 --- a/us-federal-laws.html +++ b/us-federal-laws.html @@ -13,7 +13,7 @@ - + @@ -209,7 +209,7 @@ }}); define({id: "0e0057e1", outputs: ["scatter"], body: async () => { -const {scatter} = await import("./_import/components/scatter.8e757dc8.js"); +const {scatter} = await import("./_import/components/scatter.e6a504c8.js"); return {scatter}; }}); @@ -245,48 +245,8 @@
- +
diff --git a/your-first-scope.html b/your-first-scope.html index 9d27234..aeba991 100644 --- a/your-first-scope.html +++ b/your-first-scope.html @@ -60,48 +60,8 @@
- +