ex4nicegui 0.3.2__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/PKG-INFO +1 -1
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/README.md +79 -1
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/__init__.py +1 -1
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/dataSource.py +4 -4
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/elements/ui_aggrid.py +1 -7
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/elements/ui_echarts.py +5 -9
- ex4nicegui-0.4.0/ex4nicegui/reactive/EChartsComponent/ECharts.js +56 -0
- ex4nicegui-0.4.0/ex4nicegui/reactive/EChartsComponent/ECharts.py +139 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/__index.py +1 -0
- ex4nicegui-0.4.0/ex4nicegui/reactive/libs/d3/d3-color.ems.js +7 -0
- ex4nicegui-0.4.0/ex4nicegui/reactive/libs/d3/d3-dispatch.ems.js +7 -0
- ex4nicegui-0.4.0/ex4nicegui/reactive/libs/d3/d3-drag.ems.js +7 -0
- ex4nicegui-0.4.0/ex4nicegui/reactive/libs/d3/d3-ease.ems.js +7 -0
- ex4nicegui-0.4.0/ex4nicegui/reactive/libs/d3/d3-interpolate.ems.js +7 -0
- ex4nicegui-0.4.0/ex4nicegui/reactive/libs/d3/d3-selection.ems.js +7 -0
- ex4nicegui-0.4.0/ex4nicegui/reactive/libs/d3/d3-timer.ems.js +7 -0
- ex4nicegui-0.4.0/ex4nicegui/reactive/libs/d3/d3-transition.ems.js +7 -0
- ex4nicegui-0.4.0/ex4nicegui/reactive/libs/d3/d3-zoom.ems.js +7 -0
- ex4nicegui-0.4.0/ex4nicegui/reactive/mermaid/__init__.py +0 -0
- ex4nicegui-0.4.0/ex4nicegui/reactive/mermaid/mermaid.js +75 -0
- ex4nicegui-0.4.0/ex4nicegui/reactive/mermaid/mermaid.py +64 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/base.py +2 -1
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/checkbox.py +2 -1
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/date.py +2 -1
- ex4nicegui-0.4.0/ex4nicegui/reactive/officials/echarts.py +179 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/input.py +2 -1
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/label.py +2 -2
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/radio.py +2 -1
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/select.py +3 -10
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/slider.py +2 -1
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/switch.py +2 -1
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/table.py +7 -10
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/textarea.py +2 -1
- ex4nicegui-0.4.0/ex4nicegui/reactive/useMouse/__init__.py +0 -0
- ex4nicegui-0.4.0/ex4nicegui/utils/__init__.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/utils/clientScope.py +3 -3
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui.egg-info/PKG-INFO +1 -1
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui.egg-info/SOURCES.txt +14 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui.egg-info/requires.txt +1 -1
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/setup.py +1 -1
- ex4nicegui-0.3.2/ex4nicegui/reactive/EChartsComponent/ECharts.js +0 -43994
- ex4nicegui-0.3.2/ex4nicegui/reactive/EChartsComponent/ECharts.py +0 -100
- ex4nicegui-0.3.2/ex4nicegui/reactive/officials/echarts.py +0 -82
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/LICENSE +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/__init__.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/dataSourceFacade.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/elements/__init__.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/elements/containers.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/elements/layouts.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/elements/models.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/elements/text.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/elements/ui_date_picker.js +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/elements/ui_date_picker.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/elements/ui_radio.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/elements/ui_range.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/elements/ui_select.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/elements/ui_slider.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/index.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/protocols.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/bi/types.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/experimental_/__init__.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/experimental_/gridLayout/__init__.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/experimental_/gridLayout/index.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/layout/__init__.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/layout/gridFlex/GridFlex.js +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/layout/gridFlex/__init__.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/layout/gridFlex/gridFlex.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/layout/gridFlex/utils.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/layout/rxFlex/__init__.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/layout/rxFlex/index.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/layout/rxFlex/types.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/EChartsComponent/__init__.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/UseDraggable/UseDraggable.js +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/UseDraggable/UseDraggable.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/UseDraggable/__init__.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/__init__.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/drawer.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/dropZone/__init__.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/dropZone/dropZone.js +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/dropZone/dropZone.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/fileWatcher.py +0 -0
- {ex4nicegui-0.3.2/ex4nicegui/reactive/useMouse → ex4nicegui-0.4.0/ex4nicegui/reactive/libs}/__init__.py +0 -0
- {ex4nicegui-0.3.2/ex4nicegui/utils → ex4nicegui-0.4.0/ex4nicegui/reactive/libs/d3}/__init__.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/local_file_picker.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/__init__.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/aggrid.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/button.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/card.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/color_picker.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/column.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/drawer.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/expansion.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/grid.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/html.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/icon.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/image.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/number.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/row.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/upload.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/officials/utils.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/q_pagination.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/rxui.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/useMouse/UseMouse.js +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/useMouse/UseMouse.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/reactive/usePagination.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/tools/__init__.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/tools/debug.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/utils/common.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui/utils/signals.py +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui.egg-info/dependency_links.txt +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui.egg-info/not-zip-safe +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/ex4nicegui.egg-info/top_level.txt +0 -0
- {ex4nicegui-0.3.2 → ex4nicegui-0.4.0}/setup.cfg +0 -0
|
@@ -82,6 +82,83 @@ ui.run()
|
|
|
82
82
|

|
|
83
83
|
|
|
84
84
|
|
|
85
|
+
### echarts 图表鼠标事件
|
|
86
|
+
|
|
87
|
+
`on` 函数参数 `event_name` 以及 `query` 使用,查看[echarts 事件中文文档](https://echarts.apache.org/handbook/zh/concepts/event/)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
以下例子绑定鼠标单击事件
|
|
91
|
+
```python
|
|
92
|
+
from nicegui import ui
|
|
93
|
+
from ex4nicegui.reactive import rxui
|
|
94
|
+
|
|
95
|
+
opts = {
|
|
96
|
+
"xAxis": {"type": "value", "boundaryGap": [0, 0.01]},
|
|
97
|
+
"yAxis": {
|
|
98
|
+
"type": "category",
|
|
99
|
+
"data": ["Brazil", "Indonesia", "USA", "India", "China", "World"],
|
|
100
|
+
},
|
|
101
|
+
"series": [
|
|
102
|
+
{
|
|
103
|
+
"name": "first",
|
|
104
|
+
"type": "bar",
|
|
105
|
+
"data": [18203, 23489, 29034, 104970, 131744, 630230],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "second",
|
|
109
|
+
"type": "bar",
|
|
110
|
+
"data": [19325, 23438, 31000, 121594, 134141, 681807],
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
bar = rxui.echarts(opts)
|
|
116
|
+
|
|
117
|
+
def on_click(e: rxui.echarts.EChartsMouseEventArguments):
|
|
118
|
+
ui.notify(f"on_click:{e.seriesName}:{e.name}:{e.value}")
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
bar.on("click", on_click)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
以下例子只针对指定系列触发鼠标划过事件
|
|
126
|
+
```python
|
|
127
|
+
from nicegui import ui
|
|
128
|
+
from ex4nicegui.reactive import rxui
|
|
129
|
+
|
|
130
|
+
opts = {
|
|
131
|
+
"xAxis": {"type": "value", "boundaryGap": [0, 0.01]},
|
|
132
|
+
"yAxis": {
|
|
133
|
+
"type": "category",
|
|
134
|
+
"data": ["Brazil", "Indonesia", "USA", "India", "China", "World"],
|
|
135
|
+
},
|
|
136
|
+
"series": [
|
|
137
|
+
{
|
|
138
|
+
"name": "first",
|
|
139
|
+
"type": "bar",
|
|
140
|
+
"data": [18203, 23489, 29034, 104970, 131744, 630230],
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "second",
|
|
144
|
+
"type": "bar",
|
|
145
|
+
"data": [19325, 23438, 31000, 121594, 134141, 681807],
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
bar = rxui.echarts(opts)
|
|
151
|
+
|
|
152
|
+
def on_first_series_mouseover(e: rxui.echarts.EChartsMouseEventArguments):
|
|
153
|
+
ui.notify(f"on_first_series_mouseover:{e.seriesName}:{e.name}:{e.value}")
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
bar.on("mouseover", on_first_series_mouseover, query={"seriesName": "first"})
|
|
157
|
+
|
|
158
|
+
ui.run()
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
|
|
85
162
|
|
|
86
163
|
## BI 模块
|
|
87
164
|
|
|
@@ -94,6 +171,7 @@ from nicegui import ui
|
|
|
94
171
|
import pandas as pd
|
|
95
172
|
import numpy as np
|
|
96
173
|
from ex4nicegui import bi
|
|
174
|
+
from ex4nicegui.reactive import rxui
|
|
97
175
|
from ex4nicegui import effect, effect_refreshable
|
|
98
176
|
from pyecharts.charts import Bar
|
|
99
177
|
|
|
@@ -164,7 +242,7 @@ with ui.grid(columns=2):
|
|
|
164
242
|
|
|
165
243
|
# 绑定点击事件,即可实现跳转
|
|
166
244
|
@bar2.on_chart_click
|
|
167
|
-
def _(e):
|
|
245
|
+
def _(e: rxui.echarts.EChartsMouseEventArguments):
|
|
168
246
|
ui.open(f"/details/{e.name}", new_tab=True)
|
|
169
247
|
|
|
170
248
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from typing import Callable, Dict, List, Optional, Set, cast
|
|
2
2
|
from ex4nicegui import to_ref, ref_computed, on
|
|
3
|
-
from nicegui import
|
|
3
|
+
from nicegui import context as ng_context, Client, ui
|
|
4
4
|
|
|
5
5
|
from dataclasses import dataclass, field
|
|
6
6
|
from . import types
|
|
@@ -123,7 +123,7 @@ class DataSource:
|
|
|
123
123
|
return self.__id
|
|
124
124
|
|
|
125
125
|
def get_component_info_key(self, element_id: types._TElementID):
|
|
126
|
-
client_id =
|
|
126
|
+
client_id = ng_context.get_client().id
|
|
127
127
|
return ComponentInfoKey(client_id, element_id)
|
|
128
128
|
|
|
129
129
|
def get_filtered_data(self, element: ui.element):
|
|
@@ -148,7 +148,7 @@ class DataSource:
|
|
|
148
148
|
element_id: types._TElementID,
|
|
149
149
|
update_callback: Optional[_TComponentUpdateCallback] = None,
|
|
150
150
|
):
|
|
151
|
-
ng_client =
|
|
151
|
+
ng_client = ng_context.get_client()
|
|
152
152
|
client_id = ng_client.id
|
|
153
153
|
|
|
154
154
|
if not self._component_map.has_client_record(client_id):
|
|
@@ -164,7 +164,7 @@ class DataSource:
|
|
|
164
164
|
return info
|
|
165
165
|
|
|
166
166
|
def send_filter(self, element_id: types._TElementID, filter: Filter):
|
|
167
|
-
client_id =
|
|
167
|
+
client_id = ng_context.get_client().id
|
|
168
168
|
key = ComponentInfoKey(client_id, element_id)
|
|
169
169
|
|
|
170
170
|
if not self._component_map.has_record(key):
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
-
from typing import TYPE_CHECKING,
|
|
2
|
+
from typing import TYPE_CHECKING, Callable, Union
|
|
3
3
|
from nicegui import ui
|
|
4
|
-
from nicegui.events import UiEventArguments
|
|
5
|
-
from ex4nicegui.reactive import rxui
|
|
6
|
-
from ex4nicegui.reactive.EChartsComponent.ECharts import (
|
|
7
|
-
EChartsClickEventArguments,
|
|
8
|
-
echarts,
|
|
9
|
-
)
|
|
10
4
|
from ex4nicegui.bi.dataSource import DataSource
|
|
11
5
|
from .models import UiResult
|
|
12
6
|
|
|
@@ -3,7 +3,7 @@ from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Union, cast
|
|
|
3
3
|
from nicegui.events import UiEventArguments
|
|
4
4
|
from ex4nicegui.reactive import rxui
|
|
5
5
|
from ex4nicegui.reactive.EChartsComponent.ECharts import (
|
|
6
|
-
|
|
6
|
+
EChartsMouseEventArguments,
|
|
7
7
|
echarts,
|
|
8
8
|
)
|
|
9
9
|
from nicegui import ui
|
|
@@ -21,15 +21,11 @@ class EChartsResult(UiResult[echarts]):
|
|
|
21
21
|
super().__init__(element, dataSource)
|
|
22
22
|
self.chart_update = chart_update
|
|
23
23
|
|
|
24
|
-
def on_chart_click(
|
|
25
|
-
self, handler
|
|
26
|
-
):
|
|
27
|
-
return self.element.on_chart_click(handler)
|
|
24
|
+
def on_chart_click(self, handler: Callable[[EChartsMouseEventArguments], Any]):
|
|
25
|
+
return self.element.echarts_on("click", handler)
|
|
28
26
|
|
|
29
|
-
def on_chart_click_blank(
|
|
30
|
-
self
|
|
31
|
-
):
|
|
32
|
-
return self.element.on_chart_click_blank(handler)
|
|
27
|
+
def on_chart_click_blank(self, handler: Callable[[UiEventArguments], Any]):
|
|
28
|
+
return self.element.on_click_blank(handler)
|
|
33
29
|
|
|
34
30
|
def cancel_linkage(self, *source: Union[ui.element, "UiResult"]):
|
|
35
31
|
super().cancel_linkage(*source)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { convertDynamicProperties } from "../../static/utils/dynamic_properties.js";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
template: "<div></div>",
|
|
5
|
+
mounted() {
|
|
6
|
+
this.chart = echarts.init(this.$el, this.theme);
|
|
7
|
+
this.chart.getZr().on("click", (e) => {
|
|
8
|
+
if (!e.target) {
|
|
9
|
+
this.$emit("clickBlank")
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
this.updateOptions(this.options);
|
|
15
|
+
|
|
16
|
+
this.resizeObs = new ResizeObserver(this.chart.resize)
|
|
17
|
+
this.resizeObs.observe(this.$el);
|
|
18
|
+
},
|
|
19
|
+
beforeDestroy() {
|
|
20
|
+
this.chart.dispose();
|
|
21
|
+
this.resizeObs.unobserve();
|
|
22
|
+
},
|
|
23
|
+
beforeUnmount() {
|
|
24
|
+
this.chart.dispose();
|
|
25
|
+
},
|
|
26
|
+
methods: {
|
|
27
|
+
updateOptions(options, opts) {
|
|
28
|
+
convertDynamicProperties(options, true);
|
|
29
|
+
this.chart.setOption(options, opts);
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
echarts_on(eventName, query, callbackId) {
|
|
34
|
+
this.chart.on(eventName, query, (e) => {
|
|
35
|
+
const eventParams = {
|
|
36
|
+
componentType: e.componentType,
|
|
37
|
+
seriesType: e.seriesType,
|
|
38
|
+
seriesIndex: e.seriesIndex,
|
|
39
|
+
seriesName: e.seriesName,
|
|
40
|
+
name: e.name,
|
|
41
|
+
dataIndex: e.dataIndex,
|
|
42
|
+
data: e.data,
|
|
43
|
+
dataType: e.dataType,
|
|
44
|
+
value: e.value,
|
|
45
|
+
color: e.color,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
this.$emit('event_on', { params: eventParams, callbackId })
|
|
49
|
+
})
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
props: {
|
|
53
|
+
options: Object,
|
|
54
|
+
theme: String | Object | undefined
|
|
55
|
+
},
|
|
56
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
from typing import Any, Callable, Dict, List, Optional, Union
|
|
2
|
+
from typing_extensions import Literal
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from nicegui.dataclasses import KWONLY_SLOTS
|
|
5
|
+
from nicegui.events import handle_event, UiEventArguments
|
|
6
|
+
from nicegui.element import Element
|
|
7
|
+
from nicegui import context as ng_context
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
import nicegui
|
|
10
|
+
import uuid
|
|
11
|
+
|
|
12
|
+
NG_ROOT = Path(nicegui.__file__).parent / "elements"
|
|
13
|
+
libraries = [NG_ROOT / "lib/echarts/echarts.min.js"]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
_Chart_Click_Args = [
|
|
17
|
+
"componentType",
|
|
18
|
+
"seriesType",
|
|
19
|
+
"seriesIndex",
|
|
20
|
+
"seriesName",
|
|
21
|
+
"name",
|
|
22
|
+
"dataIndex",
|
|
23
|
+
"data",
|
|
24
|
+
"dataType",
|
|
25
|
+
"value",
|
|
26
|
+
"color",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass(**KWONLY_SLOTS)
|
|
31
|
+
class EChartsMouseEventArguments(UiEventArguments):
|
|
32
|
+
componentType: str
|
|
33
|
+
seriesType: str
|
|
34
|
+
seriesIndex: int
|
|
35
|
+
seriesName: str
|
|
36
|
+
name: str
|
|
37
|
+
dataIndex: int
|
|
38
|
+
data: dict
|
|
39
|
+
dataType: Optional[str]
|
|
40
|
+
value: Any
|
|
41
|
+
color: str
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
_T_echats_on_callback = Callable[[EChartsMouseEventArguments], Any]
|
|
45
|
+
_T_mouse_event_name = Literal[
|
|
46
|
+
"click",
|
|
47
|
+
"dblclick",
|
|
48
|
+
"mousedown",
|
|
49
|
+
"mousemove",
|
|
50
|
+
"mouseup",
|
|
51
|
+
"mouseover",
|
|
52
|
+
"mouseout",
|
|
53
|
+
"globalout",
|
|
54
|
+
"contextmenu",
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class echarts(Element, component="ECharts.js", libraries=libraries): # type: ignore
|
|
59
|
+
def __init__(self, options: dict) -> None:
|
|
60
|
+
super().__init__()
|
|
61
|
+
self._props["options"] = options
|
|
62
|
+
|
|
63
|
+
self._echarts_on_tasks: List[Callable] = []
|
|
64
|
+
self._echarts_on_callback_map: Dict[str, _T_echats_on_callback] = {}
|
|
65
|
+
|
|
66
|
+
async def on_client_connect(client: nicegui.Client) -> Any:
|
|
67
|
+
await client.connected()
|
|
68
|
+
|
|
69
|
+
for func in self._echarts_on_tasks:
|
|
70
|
+
func()
|
|
71
|
+
|
|
72
|
+
client.connect_handlers.remove(on_client_connect) # type: ignore
|
|
73
|
+
|
|
74
|
+
ng_context.get_client().on_connect(on_client_connect)
|
|
75
|
+
|
|
76
|
+
def echartsOn_handler(e):
|
|
77
|
+
callbackId = e.args["callbackId"]
|
|
78
|
+
params: Dict = e.args["params"]
|
|
79
|
+
params["dataType"] = params.get("dataType")
|
|
80
|
+
|
|
81
|
+
if callbackId in self._echarts_on_callback_map:
|
|
82
|
+
event_args = EChartsMouseEventArguments(e.sender, e.client, **params)
|
|
83
|
+
handler = self._echarts_on_callback_map[callbackId]
|
|
84
|
+
|
|
85
|
+
handle_event(handler, event_args)
|
|
86
|
+
|
|
87
|
+
self.on("event_on", echartsOn_handler)
|
|
88
|
+
|
|
89
|
+
def update_options(self, options: dict, opts: Optional[dict] = None):
|
|
90
|
+
"""update chart options
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
options (dict): chart setting options dict
|
|
94
|
+
opts (Optional[dict], optional): update options. Defaults to None.
|
|
95
|
+
```python
|
|
96
|
+
{
|
|
97
|
+
'notMerge':False,
|
|
98
|
+
'lazyUpdate':False,
|
|
99
|
+
'silent':False,
|
|
100
|
+
'replaceMerge': None,
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
[open echarts setOption docs](https://echarts.apache.org/zh/api.html#echartsInstance.setOption)
|
|
104
|
+
|
|
105
|
+
"""
|
|
106
|
+
self._props["options"] = options
|
|
107
|
+
self.run_method("updateOptions", options, opts)
|
|
108
|
+
self.update()
|
|
109
|
+
return self
|
|
110
|
+
|
|
111
|
+
def on_click_blank(self, handler: Optional[Callable[[UiEventArguments], Any]]):
|
|
112
|
+
def inner_handler(e):
|
|
113
|
+
handle_event(
|
|
114
|
+
handler,
|
|
115
|
+
UiEventArguments(
|
|
116
|
+
sender=self,
|
|
117
|
+
client=self.client,
|
|
118
|
+
),
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
self.on("clickBlank", inner_handler, _Chart_Click_Args)
|
|
122
|
+
|
|
123
|
+
def echarts_on(
|
|
124
|
+
self,
|
|
125
|
+
event_name: _T_mouse_event_name,
|
|
126
|
+
handler: _T_echats_on_callback,
|
|
127
|
+
query: Optional[Union[str, Dict]] = None,
|
|
128
|
+
):
|
|
129
|
+
if not ng_context.get_client().has_socket_connection:
|
|
130
|
+
|
|
131
|
+
def task_func():
|
|
132
|
+
self.echarts_on(event_name, handler, query)
|
|
133
|
+
|
|
134
|
+
self._echarts_on_tasks.append(task_func)
|
|
135
|
+
return
|
|
136
|
+
|
|
137
|
+
callback_id = uuid.uuid4().hex
|
|
138
|
+
self.run_method("echarts_on", event_name, query, callback_id)
|
|
139
|
+
self._echarts_on_callback_map[callback_id] = handler
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
|
|
3
|
+
* Original file: /npm/d3-color@3.1.0/src/index.js
|
|
4
|
+
*
|
|
5
|
+
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
|
6
|
+
*/
|
|
7
|
+
function t(t, e, i) { t.prototype = e.prototype = i, i.constructor = t } function e(t, e) { var i = Object.create(t.prototype); for (var n in e) i[n] = e[n]; return i } function i() { } var n = .7, r = 1 / n, a = "\\s*([+-]?\\d+)\\s*", s = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", h = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", o = /^#([0-9a-f]{3,8})$/, l = new RegExp(`^rgb\\(${a},${a},${a}\\)$`), u = new RegExp(`^rgb\\(${h},${h},${h}\\)$`), c = new RegExp(`^rgba\\(${a},${a},${a},${s}\\)$`), g = new RegExp(`^rgba\\(${h},${h},${h},${s}\\)$`), p = new RegExp(`^hsl\\(${s},${h},${h}\\)$`), b = new RegExp(`^hsla\\(${s},${h},${h},${s}\\)$`), d = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, aquamarine: 8388564, azure: 15794175, beige: 16119260, bisque: 16770244, black: 0, blanchedalmond: 16772045, blue: 255, blueviolet: 9055202, brown: 10824234, burlywood: 14596231, cadetblue: 6266528, chartreuse: 8388352, chocolate: 13789470, coral: 16744272, cornflowerblue: 6591981, cornsilk: 16775388, crimson: 14423100, cyan: 65535, darkblue: 139, darkcyan: 35723, darkgoldenrod: 12092939, darkgray: 11119017, darkgreen: 25600, darkgrey: 11119017, darkkhaki: 12433259, darkmagenta: 9109643, darkolivegreen: 5597999, darkorange: 16747520, darkorchid: 10040012, darkred: 9109504, darksalmon: 15308410, darkseagreen: 9419919, darkslateblue: 4734347, darkslategray: 3100495, darkslategrey: 3100495, darkturquoise: 52945, darkviolet: 9699539, deeppink: 16716947, deepskyblue: 49151, dimgray: 6908265, dimgrey: 6908265, dodgerblue: 2003199, firebrick: 11674146, floralwhite: 16775920, forestgreen: 2263842, fuchsia: 16711935, gainsboro: 14474460, ghostwhite: 16316671, gold: 16766720, goldenrod: 14329120, gray: 8421504, green: 32768, greenyellow: 11403055, grey: 8421504, honeydew: 15794160, hotpink: 16738740, indianred: 13458524, indigo: 4915330, ivory: 16777200, khaki: 15787660, lavender: 15132410, lavenderblush: 16773365, lawngreen: 8190976, lemonchiffon: 16775885, lightblue: 11393254, lightcoral: 15761536, lightcyan: 14745599, lightgoldenrodyellow: 16448210, lightgray: 13882323, lightgreen: 9498256, lightgrey: 13882323, lightpink: 16758465, lightsalmon: 16752762, lightseagreen: 2142890, lightskyblue: 8900346, lightslategray: 7833753, lightslategrey: 7833753, lightsteelblue: 11584734, lightyellow: 16777184, lime: 65280, limegreen: 3329330, linen: 16445670, magenta: 16711935, maroon: 8388608, mediumaquamarine: 6737322, mediumblue: 205, mediumorchid: 12211667, mediumpurple: 9662683, mediumseagreen: 3978097, mediumslateblue: 8087790, mediumspringgreen: 64154, mediumturquoise: 4772300, mediumvioletred: 13047173, midnightblue: 1644912, mintcream: 16121850, mistyrose: 16770273, moccasin: 16770229, navajowhite: 16768685, navy: 128, oldlace: 16643558, olive: 8421376, olivedrab: 7048739, orange: 16753920, orangered: 16729344, orchid: 14315734, palegoldenrod: 15657130, palegreen: 10025880, paleturquoise: 11529966, palevioletred: 14381203, papayawhip: 16773077, peachpuff: 16767673, peru: 13468991, pink: 16761035, plum: 14524637, powderblue: 11591910, purple: 8388736, rebeccapurple: 6697881, red: 16711680, rosybrown: 12357519, royalblue: 4286945, saddlebrown: 9127187, salmon: 16416882, sandybrown: 16032864, seagreen: 3050327, seashell: 16774638, sienna: 10506797, silver: 12632256, skyblue: 8900331, slateblue: 6970061, slategray: 7372944, slategrey: 7372944, snow: 16775930, springgreen: 65407, steelblue: 4620980, tan: 13808780, teal: 32896, thistle: 14204888, tomato: 16737095, turquoise: 4251856, violet: 15631086, wheat: 16113331, white: 16777215, whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074 }; function f() { return this.rgb().formatHex() } function w() { return this.rgb().formatRgb() } function y(t) { var e, i; return t = (t + "").trim().toLowerCase(), (e = o.exec(t)) ? (i = e[1].length, e = parseInt(e[1], 16), 6 === i ? m(e) : 3 === i ? new M(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | 240 & e, (15 & e) << 4 | 15 & e, 1) : 8 === i ? $(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (255 & e) / 255) : 4 === i ? $(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | 240 & e, ((15 & e) << 4 | 15 & e) / 255) : null) : (e = l.exec(t)) ? new M(e[1], e[2], e[3], 1) : (e = u.exec(t)) ? new M(255 * e[1] / 100, 255 * e[2] / 100, 255 * e[3] / 100, 1) : (e = c.exec(t)) ? $(e[1], e[2], e[3], e[4]) : (e = g.exec(t)) ? $(255 * e[1] / 100, 255 * e[2] / 100, 255 * e[3] / 100, e[4]) : (e = p.exec(t)) ? E(e[1], e[2] / 100, e[3] / 100, 1) : (e = b.exec(t)) ? E(e[1], e[2] / 100, e[3] / 100, e[4]) : d.hasOwnProperty(t) ? m(d[t]) : "transparent" === t ? new M(NaN, NaN, NaN, 0) : null } function m(t) { return new M(t >> 16 & 255, t >> 8 & 255, 255 & t, 1) } function $(t, e, i, n) { return n <= 0 && (t = e = i = NaN), new M(t, e, i, n) } function N(t) { return t instanceof i || (t = y(t)), t ? new M((t = t.rgb()).r, t.g, t.b, t.opacity) : new M } function k(t, e, i, n) { return 1 === arguments.length ? N(t) : new M(t, e, i, null == n ? 1 : n) } function M(t, e, i, n) { this.r = +t, this.g = +e, this.b = +i, this.opacity = +n } function v() { return `#${R(this.r)}${R(this.g)}${R(this.b)}` } function x() { const t = q(this.opacity); return `${1 === t ? "rgb(" : "rgba("}${H(this.r)}, ${H(this.g)}, ${H(this.b)}${1 === t ? ")" : `, ${t})`}` } function q(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)) } function H(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)) } function R(t) { return ((t = H(t)) < 16 ? "0" : "") + t.toString(16) } function E(t, e, i, n) { return n <= 0 ? t = e = i = NaN : i <= 0 || i >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new O(t, e, i, n) } function j(t) { if (t instanceof O) return new O(t.h, t.s, t.l, t.opacity); if (t instanceof i || (t = y(t)), !t) return new O; if (t instanceof O) return t; var e = (t = t.rgb()).r / 255, n = t.g / 255, r = t.b / 255, a = Math.min(e, n, r), s = Math.max(e, n, r), h = NaN, o = s - a, l = (s + a) / 2; return o ? (h = e === s ? (n - r) / o + 6 * (n < r) : n === s ? (r - e) / o + 2 : (e - n) / o + 4, o /= l < .5 ? s + a : 2 - s - a, h *= 60) : o = l > 0 && l < 1 ? 0 : h, new O(h, o, l, t.opacity) } function I(t, e, i, n) { return 1 === arguments.length ? j(t) : new O(t, e, i, null == n ? 1 : n) } function O(t, e, i, n) { this.h = +t, this.s = +e, this.l = +i, this.opacity = +n } function P(t) { return (t = (t || 0) % 360) < 0 ? t + 360 : t } function S(t) { return Math.max(0, Math.min(1, t || 0)) } function z(t, e, i) { return 255 * (t < 60 ? e + (i - e) * t / 60 : t < 180 ? i : t < 240 ? e + (i - e) * (240 - t) / 60 : e) } t(i, y, { copy(t) { return Object.assign(new this.constructor, this, t) }, displayable() { return this.rgb().displayable() }, hex: f, formatHex: f, formatHex8: function () { return this.rgb().formatHex8() }, formatHsl: function () { return j(this).formatHsl() }, formatRgb: w, toString: w }), t(M, k, e(i, { brighter(t) { return t = null == t ? r : Math.pow(r, t), new M(this.r * t, this.g * t, this.b * t, this.opacity) }, darker(t) { return t = null == t ? n : Math.pow(n, t), new M(this.r * t, this.g * t, this.b * t, this.opacity) }, rgb() { return this }, clamp() { return new M(H(this.r), H(this.g), H(this.b), q(this.opacity)) }, displayable() { return -.5 <= this.r && this.r < 255.5 && -.5 <= this.g && this.g < 255.5 && -.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1 }, hex: v, formatHex: v, formatHex8: function () { return `#${R(this.r)}${R(this.g)}${R(this.b)}${R(255 * (isNaN(this.opacity) ? 1 : this.opacity))}` }, formatRgb: x, toString: x })), t(O, I, e(i, { brighter(t) { return t = null == t ? r : Math.pow(r, t), new O(this.h, this.s, this.l * t, this.opacity) }, darker(t) { return t = null == t ? n : Math.pow(n, t), new O(this.h, this.s, this.l * t, this.opacity) }, rgb() { var t = this.h % 360 + 360 * (this.h < 0), e = isNaN(t) || isNaN(this.s) ? 0 : this.s, i = this.l, n = i + (i < .5 ? i : 1 - i) * e, r = 2 * i - n; return new M(z(t >= 240 ? t - 240 : t + 120, r, n), z(t, r, n), z(t < 120 ? t + 240 : t - 120, r, n), this.opacity) }, clamp() { return new O(P(this.h), S(this.s), S(this.l), q(this.opacity)) }, displayable() { return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1 }, formatHsl() { const t = q(this.opacity); return `${1 === t ? "hsl(" : "hsla("}${P(this.h)}, ${100 * S(this.s)}%, ${100 * S(this.l)}%${1 === t ? ")" : `, ${t})`}` } })); const C = Math.PI / 180, L = 180 / Math.PI, A = .96422, B = 1, D = .82521, F = 4 / 29, G = 6 / 29, J = 3 * G * G, K = G * G * G; function Q(t) { if (t instanceof V) return new V(t.l, t.a, t.b, t.opacity); if (t instanceof it) return nt(t); t instanceof M || (t = N(t)); var e, i, n = Z(t.r), r = Z(t.g), a = Z(t.b), s = W((.2225045 * n + .7168786 * r + .0606169 * a) / B); return n === r && r === a ? e = i = s : (e = W((.4360747 * n + .3850649 * r + .1430804 * a) / A), i = W((.0139322 * n + .0971045 * r + .7141733 * a) / D)), new V(116 * s - 16, 500 * (e - s), 200 * (s - i), t.opacity) } function T(t, e) { return new V(t, 0, 0, null == e ? 1 : e) } function U(t, e, i, n) { return 1 === arguments.length ? Q(t) : new V(t, e, i, null == n ? 1 : n) } function V(t, e, i, n) { this.l = +t, this.a = +e, this.b = +i, this.opacity = +n } function W(t) { return t > K ? Math.pow(t, 1 / 3) : t / J + F } function X(t) { return t > G ? t * t * t : J * (t - F) } function Y(t) { return 255 * (t <= .0031308 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - .055) } function Z(t) { return (t /= 255) <= .04045 ? t / 12.92 : Math.pow((t + .055) / 1.055, 2.4) } function _(t) { if (t instanceof it) return new it(t.h, t.c, t.l, t.opacity); if (t instanceof V || (t = Q(t)), 0 === t.a && 0 === t.b) return new it(NaN, 0 < t.l && t.l < 100 ? 0 : NaN, t.l, t.opacity); var e = Math.atan2(t.b, t.a) * L; return new it(e < 0 ? e + 360 : e, Math.sqrt(t.a * t.a + t.b * t.b), t.l, t.opacity) } function tt(t, e, i, n) { return 1 === arguments.length ? _(t) : new it(i, e, t, null == n ? 1 : n) } function et(t, e, i, n) { return 1 === arguments.length ? _(t) : new it(t, e, i, null == n ? 1 : n) } function it(t, e, i, n) { this.h = +t, this.c = +e, this.l = +i, this.opacity = +n } function nt(t) { if (isNaN(t.h)) return new V(t.l, 0, 0, t.opacity); var e = t.h * C; return new V(t.l, Math.cos(e) * t.c, Math.sin(e) * t.c, t.opacity) } t(V, U, e(i, { brighter(t) { return new V(this.l + 18 * (null == t ? 1 : t), this.a, this.b, this.opacity) }, darker(t) { return new V(this.l - 18 * (null == t ? 1 : t), this.a, this.b, this.opacity) }, rgb() { var t = (this.l + 16) / 116, e = isNaN(this.a) ? t : t + this.a / 500, i = isNaN(this.b) ? t : t - this.b / 200; return new M(Y(3.1338561 * (e = A * X(e)) - 1.6168667 * (t = B * X(t)) - .4906146 * (i = D * X(i))), Y(-.9787684 * e + 1.9161415 * t + .033454 * i), Y(.0719453 * e - .2289914 * t + 1.4052427 * i), this.opacity) } })), t(it, et, e(i, { brighter(t) { return new it(this.h, this.c, this.l + 18 * (null == t ? 1 : t), this.opacity) }, darker(t) { return new it(this.h, this.c, this.l - 18 * (null == t ? 1 : t), this.opacity) }, rgb() { return nt(this).rgb() } })); var rt = -.14861, at = 1.78277, st = -.29227, ht = -.90649, ot = 1.97294, lt = ot * ht, ut = ot * at, ct = at * st - ht * rt; function gt(t, e, i, n) { return 1 === arguments.length ? function (t) { if (t instanceof pt) return new pt(t.h, t.s, t.l, t.opacity); t instanceof M || (t = N(t)); var e = t.r / 255, i = t.g / 255, n = t.b / 255, r = (ct * n + lt * e - ut * i) / (ct + lt - ut), a = n - r, s = (ot * (i - r) - st * a) / ht, h = Math.sqrt(s * s + a * a) / (ot * r * (1 - r)), o = h ? Math.atan2(s, a) * L - 120 : NaN; return new pt(o < 0 ? o + 360 : o, h, r, t.opacity) }(t) : new pt(t, e, i, null == n ? 1 : n) } function pt(t, e, i, n) { this.h = +t, this.s = +e, this.l = +i, this.opacity = +n } t(pt, gt, e(i, { brighter(t) { return t = null == t ? r : Math.pow(r, t), new pt(this.h, this.s, this.l * t, this.opacity) }, darker(t) { return t = null == t ? n : Math.pow(n, t), new pt(this.h, this.s, this.l * t, this.opacity) }, rgb() { var t = isNaN(this.h) ? 0 : (this.h + 120) * C, e = +this.l, i = isNaN(this.s) ? 0 : this.s * e * (1 - e), n = Math.cos(t), r = Math.sin(t); return new M(255 * (e + i * (rt * n + at * r)), 255 * (e + i * (st * n + ht * r)), 255 * (e + i * (ot * n)), this.opacity) } })); export { y as color, gt as cubehelix, T as gray, et as hcl, I as hsl, U as lab, tt as lch, k as rgb }; export default null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
|
|
3
|
+
* Original file: /npm/d3-dispatch@3.0.1/src/index.js
|
|
4
|
+
*
|
|
5
|
+
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
|
6
|
+
*/
|
|
7
|
+
var n = { value: () => { } }; function r() { for (var n, r = 0, e = arguments.length, o = {}; r < e; ++r) { if (!(n = arguments[r] + "") || n in o || /[\s.]/.test(n)) throw new Error("illegal type: " + n); o[n] = [] } return new t(o) } function t(n) { this._ = n } function e(n, r) { for (var t, e = 0, o = n.length; e < o; ++e)if ((t = n[e]).name === r) return t.value } function o(r, t, e) { for (var o = 0, i = r.length; o < i; ++o)if (r[o].name === t) { r[o] = n, r = r.slice(0, o).concat(r.slice(o + 1)); break } return null != e && r.push({ name: t, value: e }), r } t.prototype = r.prototype = { constructor: t, on: function (n, r) { var t, i, l = this._, a = (i = l, (n + "").trim().split(/^|\s+/).map((function (n) { var r = "", t = n.indexOf("."); if (t >= 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 (; ++f < u;)if (t = (n = a[f]).type) l[t] = o(l[t], n.name, r); else if (null == r) for (t in l) l[t] = o(l[t], n.name, null); return this } for (; ++f < u;)if ((t = (n = a[f]).type) && (t = e(l[t], n.name))) return t }, copy: function () { var n = {}, r = this._; for (var e in r) n[e] = r[e].slice(); return new t(n) }, call: function (n, r) { if ((t = arguments.length - 2) > 0) for (var t, e, o = new Array(t), i = 0; i < t; ++i)o[i] = arguments[i + 2]; if (!this._.hasOwnProperty(n)) throw new Error("unknown type: " + n); for (i = 0, t = (e = this._[n]).length; i < t; ++i)e[i].value.apply(r, o) }, apply: function (n, r, t) { if (!this._.hasOwnProperty(n)) throw new Error("unknown type: " + n); for (var e = this._[n], o = 0, i = e.length; o < i; ++o)e[o].value.apply(r, t) } }; export { r as dispatch }; export default null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
|
|
3
|
+
* Original file: /npm/d3-drag@3.0.0/src/index.js
|
|
4
|
+
*
|
|
5
|
+
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
|
6
|
+
*/
|
|
7
|
+
import { dispatch as e } from "d3-dispatch"; import { select as t, pointer as n } from "d3-selection"; const r = { passive: !1 }, o = { capture: !0, passive: !1 }; function a(e) { e.stopImmediatePropagation() } function i(e) { e.preventDefault(), e.stopImmediatePropagation() } function u(e) { var n = e.document.documentElement, r = t(e).on("dragstart.drag", i, o); "onselectstart" in n ? r.on("selectstart.drag", i, o) : (n.__noselect = n.style.MozUserSelect, n.style.MozUserSelect = "none") } function c(e, n) { var r = e.document.documentElement, a = t(e).on("dragstart.drag", null); n && (a.on("click.drag", i, o), setTimeout((function () { a.on("click.drag", null) }), 0)), "onselectstart" in r ? a.on("selectstart.drag", null) : (r.style.MozUserSelect = r.__noselect, delete r.__noselect) } var l = e => () => 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; n < u; ++n)(r = X(this, i, e, t, o[n].identifier, o[n])) && (a(e), r("start", e, o[n])) } } function U(e) { var t, n, r = e.changedTouches, o = r.length; for (t = 0; t < o; ++t)(n = E[r[t].identifier]) && (i(e), n("drag", e, r[t])) } function I(e) { var t, n, r = e.changedTouches, o = r.length; for (b && clearTimeout(b), b = setTimeout((function () { b = null }), 500), t = 0; t < o; ++t)(n = E[r[t].identifier]) && (a(e), n("end", e, r[t])) } function X(e, t, r, o, a, i) { var u, c, l, f = T.copy(), d = n(i || r, t); if (null != (l = _.call(e, new s("beforestart", { sourceEvent: r, target: M, identifier: a, active: j, x: d[0], y: d[1], dx: 0, dy: 0, dispatch: f }), o))) return u = l.x - d[0] || 0, c = l.y - d[1] || 0, function r(i, g, h) { var m, v = d; switch (i) { case "start": E[a] = r, m = j++; break; case "end": delete E[a], --j; case "drag": d = n(h || g, t), m = j }f.call(i, e, new s(i, { sourceEvent: g, subject: l, target: M, identifier: a, active: m, x: d[0] + u, y: d[1] + c, dx: d[0] - v[0], dy: d[1] - v[1], dispatch: f }), o) } } return M.filter = function (e) { return arguments.length ? (y = "function" == typeof e ? e : l(!!e), M) : y }, M.container = function (e) { return arguments.length ? (x = "function" == typeof e ? e : l(e), M) : x }, M.subject = function (e) { return arguments.length ? (_ = "function" == typeof e ? e : l(e), M) : _ }, M.touchable = function (e) { return arguments.length ? (w = "function" == typeof e ? e : l(!!e), M) : w }, M.on = function () { var e = T.on.apply(T, arguments); return e === T ? M : e }, M.clickDistance = function (e) { return arguments.length ? (k = (e = +e) * e, M) : Math.sqrt(k) }, M } s.prototype.on = function () { var e = this._.on.apply(this._, arguments); return e === this._ ? this : e }; export { m as drag, u as dragDisable, c as dragEnable }; export default null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
|
|
3
|
+
* Original file: /npm/d3-ease@3.0.1/src/index.js
|
|
4
|
+
*
|
|
5
|
+
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
|
6
|
+
*/
|
|
7
|
+
const n = n => +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) < E ? S * n * n : n < P ? S * (n -= m) * n + w : n < k ? S * (n -= b) * n + q : S * (n -= y) * n + Q } function j(n) { return ((n *= 2) <= 1 ? 1 - g(1 - n) : g(n - 1) + 1) / 2 } var z = 1.70158, A = function n(t) { function e(n) { return (n = +n) * n * (t * (n - 1) + n) } return t = +t, e.overshoot = n, e }(z), D = function n(t) { function e(n) { return --n * n * ((n + 1) * t + n) + 1 } return t = +t, e.overshoot = n, e }(z), F = function n(t) { function e(n) { return ((n *= 2) < 1 ? n * n * ((t + 1) * n - t) : (n -= 2) * n * ((t + 1) * n + t) + 2) / 2 } return t = +t, e.overshoot = n, e }(z), G = 2 * Math.PI, H = function n(t, e) { var a = Math.asin(1 / (t = Math.max(1, t))) * (e /= G); function u(n) { return t * l(- --n) * Math.sin((a - n) / e) } return u.amplitude = function (t) { return n(t, e * G) }, u.period = function (e) { return n(t, e) }, u }(1, .3), J = function n(t, e) { var a = Math.asin(1 / (t = Math.max(1, t))) * (e /= G); function u(n) { return 1 - t * l(n = +n) * Math.sin((n + a) / e) } return u.amplitude = function (t) { return n(t, e * G) }, u.period = function (e) { return n(t, e) }, u }(1, .3), K = function n(t, e) { var a = Math.asin(1 / (t = Math.max(1, t))) * (e /= G); function u(n) { return ((n = 2 * n - 1) < 0 ? t * l(-n) * Math.sin((a - n) / e) : 2 - t * l(n) * Math.sin((a + n) / e)) / 2 } return u.amplitude = function (t) { return n(t, e * G) }, u.period = function (e) { return n(t, e) }, u }(1, .3); export { F as easeBack, A as easeBackIn, F as easeBackInOut, D as easeBackOut, g as easeBounce, L as easeBounceIn, j as easeBounceInOut, g as easeBounceOut, C as easeCircle, v as easeCircleIn, C as easeCircleInOut, B as easeCircleOut, s as easeCubic, u as easeCubicIn, s as easeCubicInOut, r as easeCubicOut, J as easeElastic, H as easeElasticIn, K as easeElasticInOut, J as easeElasticOut, d as easeExp, O as easeExpIn, d as easeExpInOut, x as easeExpOut, n as easeLinear, c as easePoly, o as easePolyIn, c as easePolyInOut, i as easePolyOut, a as easeQuad, t as easeQuadIn, a as easeQuadInOut, e as easeQuadOut, I as easeSin, M as easeSinIn, I as easeSinInOut, p as easeSinOut }; export default null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
|
|
3
|
+
* Original file: /npm/d3-interpolate@3.0.1/src/index.js
|
|
4
|
+
*
|
|
5
|
+
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
|
6
|
+
*/
|
|
7
|
+
import { rgb as t, color as n, hsl as r, lab as e, hcl as a, cubehelix as o } from "d3-color"; function u(t, n, r, e, a) { var o = t * t, u = o * t; return ((1 - 3 * t + 3 * o - u) * n + (4 - 6 * o + 3 * u) * r + (1 + 3 * t + 3 * o - 3 * u) * e + u * a) / 6 } function i(t) { var n = t.length - 1; return function (r) { var e = r <= 0 ? r = 0 : r >= 1 ? (r = 1, n - 1) : Math.floor(r * n), a = t[e], o = t[e + 1], i = e > 0 ? t[e - 1] : 2 * a - o, c = e < n - 1 ? t[e + 2] : 2 * o - a; return u((r - e / n) * n, i, a, o, c) } } function c(t) { var n = t.length; return function (r) { var e = Math.floor(((r %= 1) < 0 ? ++r : r) * n), a = t[(e + n - 1) % n], o = t[e % n], i = t[(e + 1) % n], c = t[(e + 2) % n]; return u((r - e / n) * n, a, o, i, c) } } var l = t => () => t; function s(t, n) { return function (r) { return t + r * n } } function f(t, n) { var r = n - t; return r ? s(t, r > 180 || r < -180 ? r - 360 * Math.round(r / 360) : r) : l(isNaN(t) ? n : t) } function h(t) { return 1 == (t = +t) ? p : function (n, r) { return r - n ? function (t, n, r) { return t = Math.pow(t, r), n = Math.pow(n, r) - t, r = 1 / r, function (e) { return Math.pow(t + e * n, r) } }(n, r, t) : l(isNaN(n) ? r : n) } } function p(t, n) { var r = n - t; return r ? s(t, r) : l(isNaN(t) ? n : t) } var v = function n(r) { var e = h(r); function a(n, r) { var a = e((n = t(n)).r, (r = t(r)).r), o = e(n.g, r.g), u = e(n.b, r.b), i = p(n.opacity, r.opacity); return function (t) { return n.r = a(t), n.g = o(t), n.b = u(t), n.opacity = i(t), n + "" } } return a.gamma = n, a }(1); function g(n) { return function (r) { var e, a, o = r.length, u = new Array(o), i = new Array(o), c = new Array(o); for (e = 0; e < o; ++e)a = t(r[e]), u[e] = a.r || 0, i[e] = a.g || 0, c[e] = a.b || 0; return u = n(u), i = n(i), c = n(c), a.opacity = 1, function (t) { return a.r = u(t), a.g = i(t), a.b = c(t), a + "" } } } var M = g(i), x = g(c); function y(t, n) { n || (n = []); var r, e = t ? Math.min(n.length, t.length) : 0, a = n.slice(); return function (o) { for (r = 0; r < e; ++r)a[r] = t[r] * (1 - o) + n[r] * o; return a } } function b(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView) } function w(t, n) { return (b(n) ? y : m)(t, n) } function m(t, n) { var r, e = n ? n.length : 0, a = t ? Math.min(e, t.length) : 0, o = new Array(a), u = new Array(e); for (r = 0; r < a; ++r)o[r] = R(t[r], n[r]); for (; r < e; ++r)u[r] = n[r]; return function (t) { for (r = 0; r < a; ++r)u[r] = o[r](t); return u } } function d(t, n) { var r = new Date; return t = +t, n = +n, function (e) { return r.setTime(t * (1 - e) + n * e), r } } function X(t, n) { return t = +t, n = +n, function (r) { return t * (1 - r) + n * r } } function A(t, n) { var r, e = {}, a = {}; for (r in null !== t && "object" == typeof t || (t = {}), null !== n && "object" == typeof n || (n = {}), n) r in t ? e[r] = R(t[r], n[r]) : a[r] = n[r]; return function (t) { for (r in e) a[r] = e[r](t); return a } } var N = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Y = new RegExp(N.source, "g"); function D(t, n) { var r, e, a, o = N.lastIndex = Y.lastIndex = 0, u = -1, i = [], c = []; for (t += "", n += ""; (r = N.exec(t)) && (e = Y.exec(n));)(a = e.index) > o && (a = n.slice(o, a), i[u] ? i[u] += a : i[++u] = a), (r = r[0]) === (e = e[0]) ? i[u] ? i[u] += e : i[++u] = e : (i[++u] = null, c.push({ i: u, x: X(r, e) })), o = Y.lastIndex; return o < n.length && (a = n.slice(o), i[u] ? i[u] += a : i[++u] = a), i.length < 2 ? c[0] ? function (t) { return function (n) { return t(n) + "" } }(c[0].x) : function (t) { return function () { return t } }(n) : (n = c.length, function (t) { for (var r, e = 0; e < n; ++e)i[(r = c[e]).i] = r.x(t); return i.join("") }) } function R(t, r) { var e, a = typeof r; return null == r || "boolean" === a ? l(r) : ("number" === a ? X : "string" === a ? (e = n(r)) ? (r = e, v) : D : r instanceof n ? v : r instanceof Date ? d : b(r) ? y : Array.isArray(r) ? m : "function" != typeof r.valueOf && "function" != typeof r.toString || isNaN(r) ? A : X)(t, r) } function S(t) { var n = t.length; return function (r) { return t[Math.max(0, Math.min(n - 1, Math.floor(r * n)))] } } function k(t, n) { var r = f(+t, +n); return function (t) { var n = r(t); return n - 360 * Math.floor(n / 360) } } function j(t, n) { return t = +t, n = +n, function (r) { return Math.round(t * (1 - r) + n * r) } } var q, B = 180 / Math.PI, C = { translateX: 0, translateY: 0, rotate: 0, skewX: 0, scaleX: 1, scaleY: 1 }; function H(t, n, r, e, a, o) { var u, i, c; return (u = Math.sqrt(t * t + n * n)) && (t /= u, n /= u), (c = t * r + n * e) && (r -= t * c, e -= n * c), (i = Math.sqrt(r * r + e * e)) && (r /= i, e /= i, c /= i), t * e < n * r && (t = -t, n = -n, c = -c, u = -u), { translateX: a, translateY: o, rotate: Math.atan2(n, t) * B, skewX: Math.atan(c) * B, scaleX: u, scaleY: i } } function I(t, n, r, e) { function a(t) { return t.length ? t.pop() + " " : "" } return function (o, u) { var i = [], c = []; return o = t(o), u = t(u), function (t, e, a, o, u, i) { if (t !== a || e !== o) { var c = u.push("translate(", null, n, null, r); i.push({ i: c - 4, x: X(t, a) }, { i: c - 2, x: X(e, o) }) } else (a || o) && u.push("translate(" + a + n + o + r) }(o.translateX, o.translateY, u.translateX, u.translateY, i, c), function (t, n, r, o) { t !== n ? (t - n > 180 ? n += 360 : n - t > 180 && (t += 360), o.push({ i: r.push(a(r) + "rotate(", null, e) - 2, x: X(t, n) })) : n && r.push(a(r) + "rotate(" + n + e) }(o.rotate, u.rotate, i, c), function (t, n, r, o) { t !== n ? o.push({ i: r.push(a(r) + "skewX(", null, e) - 2, x: X(t, n) }) : n && r.push(a(r) + "skewX(" + n + e) }(o.skewX, u.skewX, i, c), function (t, n, r, e, o, u) { if (t !== r || n !== e) { var i = o.push(a(o) + "scale(", null, ",", null, ")"); u.push({ i: i - 4, x: X(t, r) }, { i: i - 2, x: X(n, e) }) } else 1 === r && 1 === e || o.push(a(o) + "scale(" + r + "," + e + ")") }(o.scaleX, o.scaleY, u.scaleX, u.scaleY, i, c), o = u = null, function (t) { for (var n, r = -1, e = c.length; ++r < e;)i[(n = c[r]).i] = n.x(t); return i.join("") } } } var L = I((function (t) { const n = new ("function" == typeof DOMMatrix ? DOMMatrix : WebKitCSSMatrix)(t + ""); return n.isIdentity ? C : H(n.a, n.b, n.c, n.d, n.e, n.f) }), "px, ", "px)", "deg)"), O = I((function (t) { return null == t ? C : (q || (q = document.createElementNS("http://www.w3.org/2000/svg", "g")), q.setAttribute("transform", t), (t = q.transform.baseVal.consolidate()) ? H((t = t.matrix).a, t.b, t.c, t.d, t.e, t.f) : C) }), ", ", ")", ")"); function E(t) { return ((t = Math.exp(t)) + 1 / t) / 2 } var T = function t(n, r, e) { function a(t, a) { var o, u, i = t[0], c = t[1], l = t[2], s = a[0], f = a[1], h = a[2], p = s - i, v = f - c, g = p * p + v * v; if (g < 1e-12) u = Math.log(h / l) / n, o = function (t) { return [i + t * p, c + t * v, l * Math.exp(n * t * u)] }; else { var M = Math.sqrt(g), x = (h * h - l * l + e * g) / (2 * l * r * M), y = (h * h - l * l - e * g) / (2 * h * r * M), b = Math.log(Math.sqrt(x * x + 1) - x), w = Math.log(Math.sqrt(y * y + 1) - y); u = (w - b) / n, o = function (t) { var e, a = t * u, o = E(b), s = l / (r * M) * (o * (e = n * a + b, ((e = Math.exp(2 * e)) - 1) / (e + 1)) - function (t) { return ((t = Math.exp(t)) - 1 / t) / 2 }(b)); return [i + s * p, c + s * v, l * o / E(n * a + b)] } } return o.duration = 1e3 * u * n / Math.SQRT2, o } return a.rho = function (n) { var r = Math.max(.001, +n), e = r * r; return t(r, e, e * e) }, a }(Math.SQRT2, 2, 4); function V(t) { return function (n, e) { var a = t((n = r(n)).h, (e = r(e)).h), o = p(n.s, e.s), u = p(n.l, e.l), i = p(n.opacity, e.opacity); return function (t) { return n.h = a(t), n.s = o(t), n.l = u(t), n.opacity = i(t), n + "" } } } var Q = V(f), K = V(p); function P(t, n) { var r = p((t = e(t)).l, (n = e(n)).l), a = p(t.a, n.a), o = p(t.b, n.b), u = p(t.opacity, n.opacity); return function (n) { return t.l = r(n), t.a = a(n), t.b = o(n), t.opacity = u(n), t + "" } } function W(t) { return function (n, r) { var e = t((n = a(n)).h, (r = a(r)).h), o = p(n.c, r.c), u = p(n.l, r.l), i = p(n.opacity, r.opacity); return function (t) { return n.h = e(t), n.c = o(t), n.l = u(t), n.opacity = i(t), n + "" } } } var Z = W(f), z = W(p); function F(t) { return function n(r) { function e(n, e) { var a = t((n = o(n)).h, (e = o(e)).h), u = p(n.s, e.s), i = p(n.l, e.l), c = p(n.opacity, e.opacity); return function (t) { return n.h = a(t), n.s = u(t), n.l = i(Math.pow(t, r)), n.opacity = c(t), n + "" } } return r = +r, e.gamma = n, e }(1) } var G = F(f), J = F(p); function U(t, n) { void 0 === n && (n = t, t = R); for (var r = 0, e = n.length - 1, a = n[0], o = new Array(e < 0 ? 0 : e); r < e;)o[r] = t(a, a = n[++r]); return function (t) { var n = Math.max(0, Math.min(e - 1, Math.floor(t *= e))); return o[n](t - n) } } function $(t, n) { for (var r = new Array(n), e = 0; e < n; ++e)r[e] = t(e / (n - 1)); return r } export { R as interpolate, w as interpolateArray, i as interpolateBasis, c as interpolateBasisClosed, G as interpolateCubehelix, J as interpolateCubehelixLong, d as interpolateDate, S as interpolateDiscrete, Z as interpolateHcl, z as interpolateHclLong, Q as interpolateHsl, K as interpolateHslLong, k as interpolateHue, P as interpolateLab, X as interpolateNumber, y as interpolateNumberArray, A as interpolateObject, v as interpolateRgb, M as interpolateRgbBasis, x as interpolateRgbBasisClosed, j as interpolateRound, D as interpolateString, L as interpolateTransformCss, O as interpolateTransformSvg, T as interpolateZoom, U as piecewise, $ as quantize }; export default null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
|
|
3
|
+
* Original file: /npm/d3-selection@3.0.0/src/index.js
|
|
4
|
+
*
|
|
5
|
+
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
|
6
|
+
*/
|
|
7
|
+
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; s < a; ++s)(u = n[s]) ? (u.__data__ = o[s], r[s] = u) : e[s] = new m(t, o[s]); for (; s < c; ++s)(u = n[s]) && (i[s] = u) } function w(t, n, e, r, i, o, u) { var s, c, a, l = new Map, f = n.length, h = o.length, p = new Array(f); for (s = 0; s < f; ++s)(c = n[s]) && (p[s] = a = u.call(c, c.__data__, s, n) + "", l.has(a) ? i[s] = c : l.set(a, c)); for (s = 0; s < h; ++s)a = u.call(t, o[s], s, o) + "", (c = l.get(a)) ? (r[s] = c, c.__data__ = o[s], l.delete(a)) : e[s] = new m(t, o[s]); for (s = 0; s < f; ++s)(c = n[s]) && l.get(p[s]) === c && (i[s] = c) } function A(t) { return t.__data__ } function x(t) { return "object" == typeof t && "length" in t ? t : Array.from(t) } function S(t, n) { return t < n ? -1 : t > n ? 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 < i;)e.add(n[r]) } function X(t, n) { for (var e = H(t), r = -1, i = n.length; ++r < i;)e.remove(n[r]) } function G(t) { return function () { U(this, t) } } function Y(t) { return function () { X(this, t) } } function k(t, n) { return function () { (n.apply(this, arguments) ? U : X)(this, t) } } function z() { this.textContent = "" } function F(t) { return function () { this.textContent = t } } function J(t) { return function () { var n = t.apply(this, arguments); this.textContent = null == n ? "" : n } } function K() { this.innerHTML = "" } function Q(t) { return function () { this.innerHTML = t } } function W(t) { return function () { var n = t.apply(this, arguments); this.innerHTML = null == n ? "" : n } } function Z() { this.nextSibling && this.parentNode.appendChild(this) } function $() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild) } function tt() { return null } function nt() { var t = this.parentNode; t && t.removeChild(this) } function et() { var t = this.cloneNode(!1), n = this.parentNode; return n ? n.insertBefore(t, this.nextSibling) : t } function rt() { var t = this.cloneNode(!0), n = this.parentNode; return n ? n.insertBefore(t, this.nextSibling) : t } function it(t) { return function () { var n = this.__on; if (n) { for (var e, r = 0, i = -1, o = n.length; r < o; ++r)e = n[r], t.type && e.type !== t.type || e.name !== t.name ? n[++i] = e : this.removeEventListener(e.type, e.listener, e.options); ++i ? n.length = i : delete this.__on } } } function ot(t, n, e) { return function () { var r, i = this.__on, o = function (t) { return function (n) { t.call(this, n, this.__data__) } }(n); if (i) for (var u = 0, s = i.length; u < s; ++u)if ((r = i[u]).type === t.type && r.name === t.name) return this.removeEventListener(r.type, r.listener, r.options), this.addEventListener(r.type, r.listener = o, r.options = e), void (r.value = n); this.addEventListener(t.type, o, e), r = { type: t.type, name: t.name, value: n, listener: o, options: e }, i ? i.push(r) : this.__on = [r] } } function ut(t, n, e) { var r = P(t), i = r.CustomEvent; "function" == typeof i ? i = new i(n, e) : (i = r.document.createEvent("Event"), e ? (i.initEvent(n, e.bubbles, e.cancelable), i.detail = e.detail) : i.initEvent(n, !1, !1)), t.dispatchEvent(i) } function st(t, n) { return function () { return ut(this, t, n) } } function ct(t, n) { return function () { return ut(this, t, n.apply(this, arguments)) } } m.prototype = { constructor: m, appendChild: function (t) { return this._parent.insertBefore(t, this._next) }, insertBefore: function (t, n) { return this._parent.insertBefore(t, n) }, querySelector: function (t) { return this._parent.querySelector(t) }, querySelectorAll: function (t) { return this._parent.querySelectorAll(t) } }, I.prototype = { add: function (t) { this._names.indexOf(t) < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))) }, remove: function (t) { var n = this._names.indexOf(t); n >= 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; ++i)for (var o, u, c = n[i], a = c.length, l = r[i] = new Array(a), f = 0; f < a; ++f)(o = c[f]) && (u = t.call(o, o.__data__, f, c)) && ("__data__" in o && (u.__data__ = o.__data__), l[f] = u); return new lt(r, this._parents) }, selectAll: function (t) { t = "function" == typeof t ? function (t) { return function () { return c(t.apply(this, arguments)) } }(t) : l(t); for (var n = this._groups, e = n.length, r = [], i = [], o = 0; o < e; ++o)for (var u, s = n[o], a = s.length, f = 0; f < a; ++f)(u = s[f]) && (r.push(t.call(u, u.__data__, f, s)), i.push(u)); return new lt(r, i) }, selectChild: function (t) { return this.select(null == t ? _ : function (t) { return function () { return p.call(this.children, t) } }("function" == typeof t ? t : h(t))) }, selectChildren: function (t) { return this.selectAll(null == t ? y : function (t) { return function () { return d.call(this.children, t) } }("function" == typeof t ? t : h(t))) }, filter: function (t) { "function" != typeof t && (t = f(t)); for (var n = this._groups, e = n.length, r = new Array(e), i = 0; i < e; ++i)for (var o, u = n[i], s = u.length, c = r[i] = [], a = 0; a < s; ++a)(o = u[a]) && t.call(o, o.__data__, a, u) && c.push(o); return new lt(r, this._parents) }, data: function (t, n) { if (!arguments.length) return Array.from(this, A); var e, r = n ? w : g, i = this._parents, o = this._groups; "function" != typeof t && (e = t, t = function () { return e }); for (var u = o.length, s = new Array(u), c = new Array(u), a = new Array(u), l = 0; l < u; ++l) { var f = i[l], h = o[l], p = h.length, _ = x(t.call(f, f && f.__data__, l, i)), d = _.length, y = c[l] = new Array(d), v = s[l] = new Array(d); r(f, h, y, v, a[l] = new Array(p), _, n); for (var m, S, b = 0, E = 0; b < d; ++b)if (m = y[b]) { for (b >= E && (E = b + 1); !(S = v[E]) && ++E < d;); m._next = S || null } } return (s = new lt(s, i))._enter = c, s._exit = a, s }, enter: function () { return new lt(this._enter || this._groups.map(v), this._parents) }, exit: function () { return new lt(this._exit || this._groups.map(v), this._parents) }, join: function (t, n, e) { var r = this.enter(), i = this, o = this.exit(); return "function" == typeof t ? (r = t(r)) && (r = r.selection()) : r = r.append(t + ""), null != n && (i = n(i)) && (i = i.selection()), null == e ? o.remove() : e(o), r && i ? r.merge(i).order() : i }, merge: function (t) { for (var n = t.selection ? t.selection() : t, e = this._groups, r = n._groups, i = e.length, o = r.length, u = Math.min(i, o), s = new Array(i), c = 0; c < u; ++c)for (var a, l = e[c], f = r[c], h = l.length, p = s[c] = new Array(h), _ = 0; _ < h; ++_)(a = l[_] || f[_]) && (p[_] = a); for (; c < i; ++c)s[c] = e[c]; return new lt(s, this._parents) }, selection: function () { return this }, order: function () { for (var t = this._groups, n = -1, e = t.length; ++n < e;)for (var r, i = t[n], o = i.length - 1, u = i[o]; --o >= 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; o < r; ++o) { for (var u, s = e[o], c = s.length, a = i[o] = new Array(c), l = 0; l < c; ++l)(u = s[l]) && (a[l] = u); a.sort(n) } return new lt(i, this._parents).order() }, call: function () { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this }, nodes: function () { return Array.from(this) }, node: function () { for (var t = this._groups, n = 0, e = t.length; n < e; ++n)for (var r = t[n], i = 0, o = r.length; i < o; ++i) { var u = r[i]; if (u) return u } return null }, size: function () { let t = 0; for (const n of this) ++t; return t }, empty: function () { return !this.node() }, each: function (t) { for (var n = this._groups, e = 0, r = n.length; e < r; ++e)for (var i, o = n[e], u = 0, s = o.length; u < s; ++u)(i = o[u]) && t.call(i, i.__data__, u, o); return this }, attr: function (t, n) { var r = e(t); if (arguments.length < 2) { var i = this.node(); return r.local ? i.getAttributeNS(r.space, r.local) : i.getAttribute(r) } return this.each((null == n ? r.local ? E : b : "function" == typeof n ? r.local ? B : L : r.local ? C : N)(r, n)) }, style: function (t, n, e) { return arguments.length > 1 ? 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 < o;)if (!r.contains(e[i])) return !1; return !0 } return this.each(("function" == typeof n ? k : n ? G : Y)(e, n)) }, text: function (t) { return arguments.length ? this.each(null == t ? z : ("function" == typeof t ? J : F)(t)) : this.node().textContent }, html: function (t) { return arguments.length ? this.each(null == t ? K : ("function" == typeof t ? W : Q)(t)) : this.node().innerHTML }, raise: function () { return this.each(Z) }, lower: function () { return this.each($) }, append: function (t) { var n = "function" == typeof t ? t : o(t); return this.select((function () { return this.appendChild(n.apply(this, arguments)) })) }, insert: function (t, n) { var e = "function" == typeof t ? t : o(t), r = null == n ? tt : "function" == typeof n ? n : s(n); return this.select((function () { return this.insertBefore(e.apply(this, arguments), r.apply(this, arguments) || null) })) }, remove: function () { return this.each(nt) }, clone: function (t) { return this.select(t ? rt : et) }, datum: function (t) { return arguments.length ? this.property("__data__", t) : this.node().__data__ }, on: function (t, n, e) { var r, i, o = function (t) { return t.trim().split(/^|\s+/).map((function (t) { var n = "", e = t.indexOf("."); return e >= 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; r < u; ++r)this.each(s(o[r], n, e)); return this } var s = this.node().__on; if (s) for (var c, a = 0, l = s.length; a < l; ++a)for (r = 0, c = s[a]; r < u; ++r)if ((i = o[r]).type === c.type && i.name === c.name) return c.value }, dispatch: function (t, n) { return this.each(("function" == typeof n ? ct : st)(t, n)) }, [Symbol.iterator]: function* () { for (var t = this._groups, n = 0, e = t.length; n < e; ++n)for (var r, i = t[n], o = 0, u = i.length; o < u; ++o)(r = i[o]) && (yield r) } }; var _t = 0; function dt() { return new yt } function yt() { this._ = "@" + (++_t).toString(36) } function vt(t) { let n; for (; n = t.sourceEvent;)t = n; return t } function mt(t, n) { if (t = vt(t), void 0 === n && (n = t.currentTarget), n) { var e = n.ownerSVGElement || n; if (e.createSVGPoint) { var r = e.createSVGPoint(); return r.x = t.clientX, r.y = t.clientY, [(r = r.matrixTransform(n.getScreenCTM().inverse())).x, r.y] } if (n.getBoundingClientRect) { var i = n.getBoundingClientRect(); return [t.clientX - i.left - n.clientLeft, t.clientY - i.top - n.clientTop] } } return [t.pageX, t.pageY] } function gt(t, n) { return t.target && (t = vt(t), void 0 === n && (n = t.currentTarget), t = t.touches || [t]), Array.from(t, (t => mt(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;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
|
|
3
|
+
* Original file: /npm/d3-timer@3.0.1/src/index.js
|
|
4
|
+
*
|
|
5
|
+
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
|
6
|
+
*/
|
|
7
|
+
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;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.17.1.
|
|
3
|
+
* Original file: /npm/d3-transition@3.0.1/src/index.js
|
|
4
|
+
*
|
|
5
|
+
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
|
6
|
+
*/
|
|
7
|
+
import { namespace as t, matcher as n, selector as e, selectorAll as r, selection as i, style as o } from "d3-selection"; import { dispatch as u } from "d3-dispatch"; import { timer as a, timeout as s, now as l } from "d3-timer"; import { interpolateNumber as f, interpolateRgb as c, interpolateString as h, interpolateTransformSvg as _, interpolateTransformCss as p } from "d3-interpolate"; import { color as v } from "d3-color"; import { easeCubicInOut as d } from "d3-ease"; 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]) : +a < n && (_.state = C, _.timer.stop(), _.on.call("cancel", t, t.__data__, _.index, _.group), delete i[a]) } if (s((function () { e.state === A && (e.state = b, e.timer.restart(l, e.delay, e.time), l(o)) })), e.state = x, e.on.call("start", t, t.__data__, e.index, e.group), e.state === x) { for (e.state = A, r = new Array(h = e.tween.length), a = 0, c = -1; a < h; ++a)(_ = e.tween[a].value.call(t, t.__data__, e.index, e.group)) && (r[++c] = _); r.length = c + 1 } } function l(n) { for (var i = n < e.duration ? e.ease.call(null, n / e.duration) : (e.timer.restart(f), e.state = E, 1), o = -1, u = r.length; ++o < u;)r[o].call(t, i); e.state === E && (e.on.call("end", t, t.__data__, e.index, e.group), f()) } function f() { for (var r in e.state = C, e.timer.stop(), delete i[n], i) return; delete t.__transition } i[n] = e, e.timer = a(o, 0, e.time) }(t, e, { name: n, index: r, group: i, on: m, tween: y, time: o.time, delay: o.delay, duration: o.duration, ease: o.ease, timer: null, state: w }) } function S(t, n) { var e = P(t, n); if (e.state > w) 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 < E, e.state = C, e.timer.stop(), e.on.call(r ? "interrupt" : "cancel", t, t.__data__, e.index, e.group), delete o[i]) : u = !1; u && delete t.__transition } } function k(t, n) { var e, r; return function () { var i = T(this, t), o = i.tween; if (o !== e) for (var u = 0, a = (r = e = o).length; u < a; ++u)if (r[u].name === n) { (r = r.slice()).splice(u, 1); break } i.tween = r } } function M(t, n, e) { var r, i; if ("function" != typeof e) throw new Error; return function () { var o = T(this, t), u = o.tween; if (u !== r) { i = (r = u).slice(); for (var a = { name: n, value: e }, s = 0, l = i.length; s < l; ++s)if (i[s].name === n) { i[s] = a; break } s === l && i.push(a) } o.tween = i } } function O(t, n, e) { var r = t._id; return t.each((function () { var t = T(this, r); (t.value || (t.value = {}))[n] = e.apply(this, arguments) })), function (t) { return P(t, r).value[n] } } function V(t, n) { var e; return ("number" == typeof n ? f : n instanceof v ? c : (e = v(n)) ? (n = e, c) : h)(t, n) } function $(t) { return function () { this.removeAttribute(t) } } function j(t) { return function () { this.removeAttributeNS(t.space, t.local) } } function q(t, n, e) { var r, i, o = e + ""; return function () { var u = this.getAttribute(t); return u === o ? null : u === r ? i : i = n(r = u, e) } } function B(t, n, e) { var r, i, o = e + ""; return function () { var u = this.getAttributeNS(t.space, t.local); return u === o ? null : u === r ? i : i = n(r = u, e) } } function D(t, n, e) { var r, i, o; return function () { var u, a, s = e(this); if (null != s) return (u = this.getAttribute(t)) === (a = s + "") ? null : u === r && a === i ? o : (i = a, o = n(r = u, s)); this.removeAttribute(t) } } function F(t, n, e) { var r, i, o; return function () { var u, a, s = e(this); if (null != s) return (u = this.getAttributeNS(t.space, t.local)) === (a = s + "") ? null : u === r && a === i ? o : (i = a, o = n(r = u, s)); this.removeAttributeNS(t.space, t.local) } } function G(t, n) { var e, r; function i() { var i = n.apply(this, arguments); return i !== r && (e = (r = i) && function (t, n) { return function (e) { this.setAttributeNS(t.space, t.local, n.call(this, e)) } }(t, i)), e } return i._value = n, i } function H(t, n) { var e, r; function i() { var i = n.apply(this, arguments); return i !== r && (e = (r = i) && function (t, n) { return function (e) { this.setAttribute(t, n.call(this, e)) } }(t, i)), e } return i._value = n, i } function I(t, n) { return function () { S(this, t).delay = +n.apply(this, arguments) } } function J(t, n) { return n = +n, function () { S(this, t).delay = n } } function K(t, n) { return function () { T(this, t).duration = +n.apply(this, arguments) } } function L(t, n) { return n = +n, function () { T(this, t).duration = n } } var Q = i.prototype.constructor; function R(t) { return function () { this.style.removeProperty(t) } } var U = 0; function W(t, n, e, r) { this._groups = t, this._parents = n, this._name = e, this._id = r } function X(t) { return i().transition(t) } function Y() { return ++U } var Z = i.prototype; W.prototype = X.prototype = { constructor: W, select: function (t) { var n = this._name, r = this._id; "function" != typeof t && (t = e(t)); for (var i = this._groups, o = i.length, u = new Array(o), a = 0; a < o; ++a)for (var s, l, f = i[a], c = f.length, h = u[a] = new Array(c), _ = 0; _ < c; ++_)(s = f[_]) && (l = t.call(s, s.__data__, _, f)) && ("__data__" in s && (l.__data__ = s.__data__), h[_] = l, N(h[_], n, r, _, h, P(s, r))); return new W(u, this._parents, n, r) }, selectAll: function (t) { var n = this._name, e = this._id; "function" != typeof t && (t = r(t)); for (var i = this._groups, o = i.length, u = [], a = [], s = 0; s < o; ++s)for (var l, f = i[s], c = f.length, h = 0; h < c; ++h)if (l = f[h]) { for (var _, p = t.call(l, l.__data__, h, f), v = P(l, e), d = 0, m = p.length; d < m; ++d)(_ = p[d]) && N(_, n, e, d, p, v); u.push(p), a.push(l) } return new W(u, a, n, e) }, selectChild: Z.selectChild, selectChildren: Z.selectChildren, filter: function (t) { "function" != typeof t && (t = n(t)); for (var e = this._groups, r = e.length, i = new Array(r), o = 0; o < r; ++o)for (var u, a = e[o], s = a.length, l = i[o] = [], f = 0; f < s; ++f)(u = a[f]) && t.call(u, u.__data__, f, a) && l.push(u); return new W(i, this._parents, this._name, this._id) }, merge: function (t) { if (t._id !== this._id) throw new Error; for (var n = this._groups, e = t._groups, r = n.length, i = e.length, o = Math.min(r, i), u = new Array(r), a = 0; a < o; ++a)for (var s, l = n[a], f = e[a], c = l.length, h = u[a] = new Array(c), _ = 0; _ < c; ++_)(s = l[_] || f[_]) && (h[_] = s); for (; a < r; ++a)u[a] = n[a]; return new W(u, this._parents, this._name, this._id) }, selection: function () { return new Q(this._groups, this._parents) }, transition: function () { for (var t = this._name, n = this._id, e = Y(), r = this._groups, i = r.length, o = 0; o < i; ++o)for (var u, a = r[o], s = a.length, l = 0; l < s; ++l)if (u = a[l]) { var f = P(u, n); N(u, t, e, l, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, ease: f.ease }) } return new W(r, this._parents, t, e) }, call: Z.call, nodes: Z.nodes, node: Z.node, size: Z.size, empty: Z.empty, each: Z.each, on: function (t, n) { var e = this._id; return arguments.length < 2 ? P(this.node(), e).on.on(t) : this.each(function (t, n, e) { var r, i, o = function (t) { return (t + "").trim().split(/^|\s+/).every((function (t) { var n = t.indexOf("."); return n >= 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; o < u; ++o)if ((r = i[o]).name === t) return r.value; return null } return this.each((null == n ? k : M)(e, t, n)) }, delay: function (t) { var n = this._id; return arguments.length ? this.each(("function" == typeof t ? I : J)(n, t)) : P(this.node(), n).delay }, duration: function (t) { var n = this._id; return arguments.length ? this.each(("function" == typeof t ? K : L)(n, t)) : P(this.node(), n).duration }, ease: function (t) { var n = this._id; return arguments.length ? this.each(function (t, n) { if ("function" != typeof n) throw new Error; return function () { T(this, t).ease = n } }(n, t)) : P(this.node(), n).ease }, easeVarying: function (t) { if ("function" != typeof t) throw new Error; return this.each(function (t, n) { return function () { var e = n.apply(this, arguments); if ("function" != typeof e) throw new Error; T(this, t).ease = e } }(this._id, t)) }, end: function () { var t, n, e = this, r = e._id, i = e.size(); return new Promise((function (o, u) { var a = { value: u }, s = { value: function () { 0 == --i && o() } }; e.each((function () { var e = T(this, r), i = e.on; i !== t && ((n = (t = i).copy())._.cancel.push(a), n._.interrupt.push(a), n._.end.push(s)), e.on = n })), 0 === i && o() })) }, [Symbol.iterator]: Z[Symbol.iterator] }; var tt = { time: null, delay: 0, duration: 250, ease: d }; function nt(t, n) { for (var e; !(e = t.__transition) || !(e = e[n]);)if (!(t = t.parentNode)) throw new Error(`transition ${n} not found`); return e } i.prototype.interrupt = function (t) { return this.each((function () { z(this, t) })) }, i.prototype.transition = function (t) { var n, e; t instanceof W ? (n = t._id, t = t._name) : (n = Y(), (e = tt).time = l(), t = null == t ? null : t + ""); for (var r = this._groups, i = r.length, o = 0; o < i; ++o)for (var u, a = r[o], s = a.length, f = 0; f < s; ++f)(u = a[f]) && N(u, t, n, f, a, e || nt(u, n)); return new W(r, this._parents, t, n) }; var et = [null]; function rt(t, n) { var e, r, i = t.__transition; if (i) for (r in n = null == n ? null : n + "", i) if ((e = i[r]).state > g && 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;
|