diff --git a/.test b/.test
index 3b878f6..67f34bb 100644
--- a/.test
+++ b/.test
@@ -1,5 +1,5 @@
-01-ingest-datasources.ipynb
-02-create-training-model.ipynb
-03-deploy-serving-model.ipynb
-04-pipeline.ipynb
+01-exploratory-data-analysis.ipynb
+02-interactive-data-preparation.ipynb
+03-ingest-with-feature-store.ipynb
+04-train-test-pipeline.ipynb
05-real-time-serving-pipeline.ipynb
\ No newline at end of file
diff --git a/1-exploratory-data-analysis.ipynb b/01-exploratory-data-analysis.ipynb
similarity index 82%
rename from 1-exploratory-data-analysis.ipynb
rename to 01-exploratory-data-analysis.ipynb
index 1ee7a31..48e9c98 100644
--- a/1-exploratory-data-analysis.ipynb
+++ b/01-exploratory-data-analysis.ipynb
@@ -35,7 +35,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "Before you run any data processing or modeling, you must start by getting to know the data you work with. The `1-exploratory-data-analysis.ipynb` notebook provides basic explanatory data analysis (EDA) on the fraud example datasets."
+ "Before you run any data processing or modeling, you must start by getting to know the data you work with. This notebook provides basic explanatory data analysis (EDA) on the fraud example datasets."
]
},
{
@@ -47,7 +47,7 @@
},
{
"cell_type": "code",
- "execution_count": 3,
+ "execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
@@ -63,17 +63,9 @@
},
{
"cell_type": "code",
- "execution_count": 4,
+ "execution_count": 2,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "> 2024-01-31 21:13:25,400 [info] Server and client versions are not the same but compatible: {'parsed_server_version': VersionInfo(major=1, minor=5, patch=2, prerelease='rc1', build='track'), 'parsed_client_version': VersionInfo(major=1, minor=3, patch=0, prerelease=None, build=None)}\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"import pandas as pd\n",
"import mlrun\n",
@@ -94,7 +86,7 @@
},
{
"cell_type": "code",
- "execution_count": 5,
+ "execution_count": 3,
"metadata": {},
"outputs": [
{
@@ -199,7 +191,7 @@
"2 7a851d0758894078b5846851ae32d5e3 "
]
},
- "execution_count": 5,
+ "execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
@@ -211,7 +203,7 @@
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": 4,
"metadata": {},
"outputs": [
{
@@ -232,7 +224,7 @@
"dtype: object"
]
},
- "execution_count": 6,
+ "execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
@@ -244,12 +236,13 @@
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
+ "age\n",
"2 149840\n",
"3 117110\n",
"4 86871\n",
@@ -258,10 +251,10 @@
"6 21377\n",
"0 1886\n",
"U 928\n",
- "Name: age, dtype: int64"
+ "Name: count, dtype: int64"
]
},
- "execution_count": 7,
+ "execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
@@ -273,7 +266,7 @@
},
{
"cell_type": "code",
- "execution_count": 8,
+ "execution_count": 6,
"metadata": {},
"outputs": [
{
@@ -303,6 +296,7 @@
"
zipMerchant | \n",
" amount | \n",
" fraud | \n",
+ " timestamp | \n",
" \n",
" \n",
" \n",
@@ -314,6 +308,7 @@
" 473745.0 | \n",
" 473745.000000 | \n",
" 473745.000000 | \n",
+ " 473745 | \n",
" \n",
" \n",
" mean | \n",
@@ -323,15 +318,7 @@
" 28007.0 | \n",
" 38.105695 | \n",
" 0.012446 | \n",
- "
\n",
- " \n",
- " std | \n",
- " 41.991176 | \n",
- " 1.325787 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 113.887429 | \n",
- " 0.110863 | \n",
+ " 2020-06-10 21:37:42.210974208 | \n",
"
\n",
" \n",
" min | \n",
@@ -341,6 +328,7 @@
" 28007.0 | \n",
" 0.000000 | \n",
" 0.000000 | \n",
+ " 2019-12-11 11:44:09.900633 | \n",
"
\n",
" \n",
" 25% | \n",
@@ -350,6 +338,7 @@
" 28007.0 | \n",
" 13.740000 | \n",
" 0.000000 | \n",
+ " 2020-03-11 13:09:03.778129920 | \n",
"
\n",
" \n",
" 50% | \n",
@@ -359,6 +348,7 @@
" 28007.0 | \n",
" 26.890000 | \n",
" 0.000000 | \n",
+ " 2020-06-10 22:26:45.202980096 | \n",
"
\n",
" \n",
" 75% | \n",
@@ -368,6 +358,7 @@
" 28007.0 | \n",
" 42.530000 | \n",
" 0.000000 | \n",
+ " 2020-09-10 03:53:20.925788928 | \n",
"
\n",
" \n",
" max | \n",
@@ -377,6 +368,17 @@
" 28007.0 | \n",
" 7665.560000 | \n",
" 1.000000 | \n",
+ " 2020-12-10 11:41:01.642802 | \n",
+ "
\n",
+ " \n",
+ " std | \n",
+ " 41.991176 | \n",
+ " 1.325787 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 113.887429 | \n",
+ " 0.110863 | \n",
+ " NaN | \n",
"
\n",
" \n",
"\n",
@@ -386,25 +388,25 @@
" step age zipcodeOri zipMerchant amount \\\n",
"count 473745.000000 473745.000000 473745.0 473745.0 473745.000000 \n",
"mean 77.698114 3.005889 28007.0 28007.0 38.105695 \n",
- "std 41.991176 1.325787 0.0 0.0 113.887429 \n",
"min 0.000000 0.000000 28007.0 28007.0 0.000000 \n",
"25% 42.000000 2.000000 28007.0 28007.0 13.740000 \n",
"50% 80.000000 3.000000 28007.0 28007.0 26.890000 \n",
"75% 114.000000 4.000000 28007.0 28007.0 42.530000 \n",
"max 147.000000 6.000000 28007.0 28007.0 7665.560000 \n",
+ "std 41.991176 1.325787 0.0 0.0 113.887429 \n",
"\n",
- " fraud \n",
- "count 473745.000000 \n",
- "mean 0.012446 \n",
- "std 0.110863 \n",
- "min 0.000000 \n",
- "25% 0.000000 \n",
- "50% 0.000000 \n",
- "75% 0.000000 \n",
- "max 1.000000 "
+ " fraud timestamp \n",
+ "count 473745.000000 473745 \n",
+ "mean 0.012446 2020-06-10 21:37:42.210974208 \n",
+ "min 0.000000 2019-12-11 11:44:09.900633 \n",
+ "25% 0.000000 2020-03-11 13:09:03.778129920 \n",
+ "50% 0.000000 2020-06-10 22:26:45.202980096 \n",
+ "75% 0.000000 2020-09-10 03:53:20.925788928 \n",
+ "max 1.000000 2020-12-10 11:41:01.642802 \n",
+ "std 0.110863 NaN "
]
},
- "execution_count": 8,
+ "execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
@@ -420,18 +422,19 @@
},
{
"cell_type": "code",
- "execution_count": 9,
+ "execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
+ "fraud\n",
"0 467849\n",
"1 5896\n",
- "Name: fraud, dtype: int64"
+ "Name: count, dtype: int64"
]
},
- "execution_count": 9,
+ "execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
@@ -457,19 +460,20 @@
},
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
+ "gender\n",
"F 258905\n",
"M 214414\n",
"U 426\n",
- "Name: gender, dtype: int64"
+ "Name: count, dtype: int64"
]
},
- "execution_count": 10,
+ "execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
@@ -481,7 +485,7 @@
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": 9,
"metadata": {},
"outputs": [
{
@@ -529,7 +533,7 @@
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": 10,
"metadata": {},
"outputs": [
{
@@ -578,7 +582,7 @@
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
@@ -595,7 +599,7 @@
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": 12,
"metadata": {},
"outputs": [
{
@@ -604,7 +608,7 @@
"Text(0.5, 1.0, 'Count of fraud/not fraud grouped by hour')"
]
},
- "execution_count": 14,
+ "execution_count": 12,
"metadata": {},
"output_type": "execute_result"
},
@@ -634,7 +638,7 @@
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": 13,
"metadata": {},
"outputs": [
{
@@ -643,7 +647,7 @@
"Text(0.5, 1.0, 'Count of fraud/not fraud for each day of the week')"
]
},
- "execution_count": 15,
+ "execution_count": 13,
"metadata": {},
"output_type": "execute_result"
},
@@ -681,7 +685,7 @@
},
{
"cell_type": "code",
- "execution_count": 16,
+ "execution_count": 14,
"metadata": {},
"outputs": [
{
@@ -754,7 +758,7 @@
"4 C394979408 password_change 2020-10-14 23:27:41.291391"
]
},
- "execution_count": 16,
+ "execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
@@ -766,7 +770,7 @@
},
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": 15,
"metadata": {},
"outputs": [
{
@@ -823,7 +827,7 @@
},
{
"cell_type": "code",
- "execution_count": 18,
+ "execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
@@ -834,7 +838,7 @@
},
{
"cell_type": "code",
- "execution_count": 19,
+ "execution_count": 17,
"metadata": {},
"outputs": [
{
@@ -877,93 +881,93 @@
" \n",
" \n",
" \n",
- " 109219 | \n",
- " 85 | \n",
+ " 139682 | \n",
" 4 | \n",
- " F | \n",
+ " 3 | \n",
+ " M | \n",
" 28007 | \n",
" 28007 | \n",
" es_transportation | \n",
- " 54.66 | \n",
+ " 28.37 | \n",
" 0 | \n",
- " 2020-03-04 07:54:50.018455 | \n",
- " 7 | \n",
- " 4 | \n",
+ " 2020-03-27 21:50:16.562414 | \n",
+ " 21 | \n",
+ " 27 | \n",
" 3 | \n",
- " 2 | \n",
+ " 4 | \n",
" 2020 | \n",
" password_change | \n",
"
\n",
" \n",
- " 240740 | \n",
- " 28 | \n",
- " 2 | \n",
- " M | \n",
+ " 98732 | \n",
+ " 21 | \n",
+ " 4 | \n",
+ " F | \n",
" 28007 | \n",
" 28007 | \n",
" es_transportation | \n",
- " 31.95 | \n",
+ " 11.76 | \n",
" 0 | \n",
- " 2020-06-13 21:14:47.709132 | \n",
- " 21 | \n",
- " 13 | \n",
- " 6 | \n",
- " 5 | \n",
+ " 2020-02-25 08:41:14.066739 | \n",
+ " 8 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1 | \n",
" 2020 | \n",
- " details_change | \n",
+ " login | \n",
"
\n",
" \n",
- " 135044 | \n",
- " 4 | \n",
- " 5 | \n",
+ " 459608 | \n",
+ " 123 | \n",
+ " 1 | \n",
" F | \n",
" 28007 | \n",
" 28007 | \n",
" es_transportation | \n",
- " 31.56 | \n",
+ " 3.29 | \n",
" 0 | \n",
- " 2020-03-24 07:52:24.099779 | \n",
- " 7 | \n",
- " 24 | \n",
- " 3 | \n",
- " 1 | \n",
+ " 2020-11-29 12:51:28.706077 | \n",
+ " 12 | \n",
+ " 29 | \n",
+ " 11 | \n",
+ " 6 | \n",
" 2020 | \n",
" password_change | \n",
"
\n",
" \n",
- " 245066 | \n",
- " 129 | \n",
- " 3 | \n",
+ " 428918 | \n",
+ " 80 | \n",
+ " 5 | \n",
" M | \n",
" 28007 | \n",
" 28007 | \n",
- " es_food | \n",
- " 18.83 | \n",
+ " es_transportation | \n",
+ " 36.56 | \n",
" 0 | \n",
- " 2020-06-17 02:14:57.581432 | \n",
+ " 2020-11-06 02:37:35.009392 | \n",
" 2 | \n",
- " 17 | \n",
" 6 | \n",
- " 2 | \n",
+ " 11 | \n",
+ " 4 | \n",
" 2020 | \n",
" login | \n",
"
\n",
" \n",
- " 30109 | \n",
- " 37 | \n",
+ " 25093 | \n",
+ " 84 | \n",
" 2 | \n",
" M | \n",
" 28007 | \n",
" 28007 | \n",
" es_transportation | \n",
- " 17.95 | \n",
+ " 42.60 | \n",
" 0 | \n",
- " 2020-01-03 15:36:39.372582 | \n",
- " 15 | \n",
- " 3 | \n",
- " 1 | \n",
- " 4 | \n",
- " 2020 | \n",
+ " 2019-12-30 19:18:41.061667 | \n",
+ " 19 | \n",
+ " 30 | \n",
+ " 12 | \n",
+ " 0 | \n",
+ " 2019 | \n",
" NaN | \n",
"
\n",
" \n",
@@ -972,28 +976,28 @@
],
"text/plain": [
" step age gender zipcodeOri zipMerchant category amount \\\n",
- "109219 85 4 F 28007 28007 es_transportation 54.66 \n",
- "240740 28 2 M 28007 28007 es_transportation 31.95 \n",
- "135044 4 5 F 28007 28007 es_transportation 31.56 \n",
- "245066 129 3 M 28007 28007 es_food 18.83 \n",
- "30109 37 2 M 28007 28007 es_transportation 17.95 \n",
+ "139682 4 3 M 28007 28007 es_transportation 28.37 \n",
+ "98732 21 4 F 28007 28007 es_transportation 11.76 \n",
+ "459608 123 1 F 28007 28007 es_transportation 3.29 \n",
+ "428918 80 5 M 28007 28007 es_transportation 36.56 \n",
+ "25093 84 2 M 28007 28007 es_transportation 42.60 \n",
"\n",
" fraud timestamp hour day month weekday year \\\n",
- "109219 0 2020-03-04 07:54:50.018455 7 4 3 2 2020 \n",
- "240740 0 2020-06-13 21:14:47.709132 21 13 6 5 2020 \n",
- "135044 0 2020-03-24 07:52:24.099779 7 24 3 1 2020 \n",
- "245066 0 2020-06-17 02:14:57.581432 2 17 6 2 2020 \n",
- "30109 0 2020-01-03 15:36:39.372582 15 3 1 4 2020 \n",
+ "139682 0 2020-03-27 21:50:16.562414 21 27 3 4 2020 \n",
+ "98732 0 2020-02-25 08:41:14.066739 8 25 2 1 2020 \n",
+ "459608 0 2020-11-29 12:51:28.706077 12 29 11 6 2020 \n",
+ "428918 0 2020-11-06 02:37:35.009392 2 6 11 4 2020 \n",
+ "25093 0 2019-12-30 19:18:41.061667 19 30 12 0 2019 \n",
"\n",
" event \n",
- "109219 password_change \n",
- "240740 details_change \n",
- "135044 password_change \n",
- "245066 login \n",
- "30109 NaN "
+ "139682 password_change \n",
+ "98732 login \n",
+ "459608 password_change \n",
+ "428918 login \n",
+ "25093 NaN "
]
},
- "execution_count": 19,
+ "execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
@@ -1020,7 +1024,7 @@
},
{
"cell_type": "code",
- "execution_count": 20,
+ "execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
@@ -1046,7 +1050,7 @@
},
{
"cell_type": "code",
- "execution_count": 21,
+ "execution_count": 19,
"metadata": {},
"outputs": [
{
@@ -1063,8 +1067,7 @@
}
],
"source": [
- "# \n",
- "corr = all_data.corr()\n",
+ "corr = all_data.corr(numeric_only=True)\n",
"plt.figure(figsize=(12, 10))\n",
"\n",
"sns.heatmap(corr[(corr >= 0.1) | (corr <= -0.1)], \n",
@@ -1076,7 +1079,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Data Analyis with MLRUN\n",
+ "## Data Analysis with MLRun\n",
"\n",
"The code in the notebook represents just a sample of the kind of analysis one can do with the data. There are a variety of tools with great visualization capabilities that can offload or automate the EDA process. You can also harness the power of MLOps solutions to create or use pre-baked functions and services that analyze your data.\n",
"The example notebook demonstrates using pre-baked functions from the MLRun public functions hub to perform EDA and modeling. Some examples:\n",
@@ -1090,13 +1093,22 @@
},
{
"cell_type": "code",
- "execution_count": 22,
+ "execution_count": 20,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "> 2024-06-13 12:38:25,203 [info] Loading project from path: {\"path\":\"./\",\"project_name\":\"fraud-demo\"}\n",
+ "> 2024-06-13 12:38:41,220 [info] Project loaded successfully: {\"path\":\"./\",\"project_name\":\"fraud-demo\",\"stored_in_db\":true}\n"
+ ]
+ }
+ ],
"source": [
"import mlrun\n",
"\n",
- "project = mlrun.load_project(\n",
+ "project = mlrun.get_or_create_project(\n",
" name=\"fraud-demo\",\n",
" context=\"./\",\n",
" user_project=True,\n",
@@ -1105,15 +1117,25 @@
},
{
"cell_type": "code",
- "execution_count": 23,
+ "execution_count": 21,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
- "> 2024-01-31 21:13:43,774 [info] Storing function: {'name': 'describe-analyze', 'uid': '21a13806928d4eb38dff918c0ac5e603', 'db': 'http://mlrun-api:8080'}\n",
- "> 2024-01-31 21:13:50,731 [info] The data set is logged to the project under dataset name\n"
+ "> 2024-06-13 12:39:01,361 [info] Storing function: {\"db\":\"http://mlrun-api:8080\",\"name\":\"describe-analyze\",\"uid\":\"ce482a518b4d4d4c88edda39a7853cc0\"}\n",
+ "> 2024-06-13 12:39:11,383 [info] The data set is logged to the project under dataset name\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "/User/.pythonlibs/mlrun-base/lib/python3.9/site-packages/mlrun/artifacts/dataset.py:387: RuntimeWarning:\n",
+ "\n",
+ "Converting input from bool to for compatibility.\n",
+ "\n"
]
},
{
@@ -1276,6 +1298,7 @@
" iter | \n",
" start | \n",
" state | \n",
+ " kind | \n",
" name | \n",
" labels | \n",
" inputs | \n",
@@ -1286,27 +1309,28 @@
" \n",
" \n",
" \n",
- " fraud-demo-pengw | \n",
- " | \n",
+ " fraud-demo-yonis | \n",
+ " | \n",
" 0 | \n",
- " Jan 31 21:13:43 | \n",
+ " Jun 13 12:39:01 | \n",
" completed | \n",
+ " run | \n",
" describe-analyze | \n",
- " v3io_user=pengw kind= owner=pengw host=jupyter-pengw-56bc6f675d-pp868 | \n",
- " table | \n",
+ " v3io_user=yonis kind=local owner=yonis host=jupyter-yoni-5d574b9596-jx5rt | \n",
+ " table | \n",
" label_column=fraud | \n",
" | \n",
- " describe-csv hist histograms scatter-2d violin imbalance imbalance-weights-vec correlation-matrix-csv correlation dataset | \n",
+ " describe-csv hist histograms scatter-2d violin imbalance imbalance-weights-vec correlation-matrix-csv correlation dataset | \n",
"
\n",
" \n",
"\n",
"\n",
- " \n",
+ "
\n",
" \n",
- " \n",
+ " \n",
"
\n",
"
\n"
],
@@ -1327,7 +1351,7 @@
{
"data": {
"text/html": [
- " > to track results use the .show() or .logs() methods or click here to open in UI"
+ " > to track results use the .show() or .logs() methods or click here to open in UI"
],
"text/plain": [
""
@@ -1340,16 +1364,13 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "> 2024-01-31 21:13:51,171 [info] run executed, status=completed: {'name': 'describe-analyze'}\n"
+ "> 2024-06-13 12:39:11,652 [info] Run execution finished: {\"name\":\"describe-analyze\",\"status\":\"completed\"}\n"
]
}
],
"source": [
"all_data.to_csv('./data_set_describe.csv', index=False)\n",
"\n",
- "\n",
- "import mlrun\n",
- "\n",
"# import the function\n",
"describe = mlrun.import_function('hub://describe')\n",
"# need to change run to descirbe_run in the book\n",
@@ -1359,7 +1380,7 @@
},
{
"cell_type": "code",
- "execution_count": 24,
+ "execution_count": 22,
"metadata": {},
"outputs": [
{
@@ -1368,7 +1389,7 @@
"dict_keys(['describe-csv', 'hist', 'histograms', 'scatter-2d', 'violin', 'imbalance', 'imbalance-weights-vec', 'correlation-matrix-csv', 'correlation', 'dataset'])"
]
},
- "execution_count": 24,
+ "execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
@@ -1380,7 +1401,7 @@
},
{
"cell_type": "code",
- "execution_count": 25,
+ "execution_count": 23,
"metadata": {},
"outputs": [
{
@@ -1454,7 +1475,7 @@
" * Copyright (c) 2014-2015, Jon Schlinkert.\n",
" * Licensed under the MIT License.\n",
" */\n",
- "\"use strict\";var n,i=\"\";e.exports=function(t,e){if(\"string\"!=typeof t)throw new TypeError(\"expected a string\");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(n!==t||void 0===n)n=t,i=\"\";else if(i.length>=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i=(i+=t).substr(0,r)}},{}],278:[function(t,e,r){(function(t){(function(){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this)}).call(this,void 0!==n?n:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}],279:[function(t,e,r){\"use strict\";e.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r,o=t[i];(l=o-((r=a+o)-a))&&(t[--n]=r,r=l)}var s=0;for(i=n;i0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],c=r[1]-n[1],u=t[2]-n[2],f=e[2]-n[2],p=r[2]-n[2],d=a*c,m=o*l,g=o*s,v=i*c,y=i*l,x=a*s,b=u*(d-m)+f*(g-v)+p*(y-x),_=7771561172376103e-31*((Math.abs(d)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(v))*Math.abs(f)+(Math.abs(y)+Math.abs(x))*Math.abs(p));return b>_||-b>_?b:h(t,e,r,n)}];function d(t){var e=p[t.length];return e||(e=p[t.length]=u(t.length)),e.apply(void 0,t)}function m(t,e,r,n,i,a,o){return function(e,r,s,l,c){switch(arguments.length){case 0:case 1:return 0;case 2:return n(e,r);case 3:return i(e,r,s);case 4:return a(e,r,s,l);case 5:return o(e,r,s,l,c)}for(var u=new Array(arguments.length),f=0;f0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===a&&0===o&&0===s&&0===l)return function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),c=r[i],u=n[i],f=Math.min(c,u);if(Math.max(c,u)=n?(i=f,(l+=1)=n?(i=f,(l+=1)>1,c=e[2*l+1];if(c===a)return l;a>1,c=e[2*l+1];if(c===a)return l;a>1,c=e[2*l+1];if(c===a)return l;a>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function u(t,e){for(var r=new Array(t.length),i=0,o=r.length;i=t.length||0!==a(t[g],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],i=(1<>>u&1&&c.push(i[u]);e.push(c)}return s(e)},r.skeleton=f,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function x(t){for(var e=v(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=y(t);if(r>=0)if(e0){var t=k[0];return g(0,M-1),M-=1,x(0),t}return-1}function w(t,e){var r=k[t];return c[r]===e?t:(c[r]=-1/0,b(t),_(),c[r]=e,b((M+=1)-1))}function T(t){if(!u[t]){u[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),A[e]>=0&&w(A[e],m(e)),A[r]>=0&&w(A[r],m(r))}}var k=[],A=new Array(a);for(f=0;f>1;f>=0;--f)x(f);for(;;){var S=_();if(S<0||c[S]>r)break;T(S)}var E=[];for(f=0;f=0&&r>=0&&e!==r){var n=A[e],i=A[r];n!==i&&C.push([n,i])}})),i.unique(i.normalize(C)),{positions:E,edges:C}};var n=t(\"robust-orientation\"),i=t(\"simplicial-complex\")},{\"robust-orientation\":284,\"simplicial-complex\":295}],298:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r,a,o,s;if(e[0][0]e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),c=n(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,a),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var n=t(\"robust-orientation\");function i(t,e){var r,i,a,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),c=Math.min(e[0][1],e[1][1]),u=Math.max(e[0][1],e[1][1]);return lu?s-u:l-u}r=e[1],i=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=c(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=c(t.right,e))return l;t=t.left}}return r}function u(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=c(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var u=c(this.slabs[e-1],t);u&&(s?o(u.key,s)>0&&(s=u.key,i=u.value):(i=u.value,s=u.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],l);if(h=f.length)return i;p=f[h]}}if(p.start)if(s){var d=a(s[0],s[1],[t[0],p.y]);s[0][0]>s[1][0]&&(d=-d),d>0&&(i=p.index)}else i=p.index;else p.y!==t[1]&&(i=p.index)}}}return i}},{\"./lib/order-segments\":298,\"binary-search-bounds\":31,\"functional-red-black-tree\":69,\"robust-orientation\":284}],300:[function(t,e,r){\"use strict\";var n=t(\"robust-dot-product\"),i=t(\"robust-sum\");function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l0||i>0&&u<0){var f=o(s,u,l,i);r.push(f),n.push(f.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=u}return{positive:r,negative:n}},e.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},e.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},{\"robust-dot-product\":281,\"robust-sum\":289}],301:[function(t,e,r){!function(){\"use strict\";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\\x25]+/,modulo:/^\\x25{2}/,placeholder:/^\\x25(?:([1-9]\\d*)\\$|\\(([^)]+)\\))?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\\d]*)/i,key_access:/^\\.([a-z_][a-z_\\d]*)/i,index_access:/^\\[(\\d+)\\]/,sign:/^[+-]/};function e(t){return i(o(t),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}function i(r,n){var i,a,o,s,l,c,u,f,h,p=1,d=r.length,m=\"\";for(a=0;a=0),s.type){case\"b\":i=parseInt(i,10).toString(2);break;case\"c\":i=String.fromCharCode(parseInt(i,10));break;case\"d\":case\"i\":i=parseInt(i,10);break;case\"j\":i=JSON.stringify(i,null,s.width?parseInt(s.width):0);break;case\"e\":i=s.precision?parseFloat(i).toExponential(s.precision):parseFloat(i).toExponential();break;case\"f\":i=s.precision?parseFloat(i).toFixed(s.precision):parseFloat(i);break;case\"g\":i=s.precision?String(Number(i.toPrecision(s.precision))):parseFloat(i);break;case\"o\":i=(parseInt(i,10)>>>0).toString(8);break;case\"s\":i=String(i),i=s.precision?i.substring(0,s.precision):i;break;case\"t\":i=String(!!i),i=s.precision?i.substring(0,s.precision):i;break;case\"T\":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=s.precision?i.substring(0,s.precision):i;break;case\"u\":i=parseInt(i,10)>>>0;break;case\"v\":i=i.valueOf(),i=s.precision?i.substring(0,s.precision):i;break;case\"x\":i=(parseInt(i,10)>>>0).toString(16);break;case\"X\":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?m+=i:(!t.number.test(s.type)||f&&!s.sign?h=\"\":(h=f?\"+\":\"-\",i=i.toString().replace(t.sign,\"\")),c=s.pad_char?\"0\"===s.pad_char?\"0\":s.pad_char.charAt(1):\" \",u=s.width-(h+i).length,l=s.width&&u>0?c.repeat(u):\"\",m+=s.align?h+i+l:\"0\"===c?h+l+i:l+h+i)}return m}var a=Object.create(null);function o(e){if(a[e])return a[e];for(var r,n=e,i=[],o=0;n;){if(null!==(r=t.text.exec(n)))i.push(r[0]);else if(null!==(r=t.modulo.exec(n)))i.push(\"%\");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError(\"[sprintf] unexpected placeholder\");if(r[2]){o|=1;var s=[],l=r[2],c=[];if(null===(c=t.key.exec(l)))throw new SyntaxError(\"[sprintf] failed to parse named argument key\");for(s.push(c[1]);\"\"!==(l=l.substring(c[0].length));)if(null!==(c=t.key_access.exec(l)))s.push(c[1]);else{if(null===(c=t.index_access.exec(l)))throw new SyntaxError(\"[sprintf] failed to parse named argument key\");s.push(c[1])}r[2]=s}else o|=2;if(3===o)throw new Error(\"[sprintf] mixing positional and named placeholders is not (yet) supported\");i.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return a[e]=i}void 0!==r&&(r.sprintf=e,r.vsprintf=n),\"undefined\"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],302:[function(t,e,r){\"use strict\";e.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=i(t,e),n=r.length,a=new Array(n),o=new Array(n),s=0;sn|0},vertex:function(t,e,r,n,i,a,o,s,l,c,u,f,h){var p=(o<<0)+(s<<1)+(l<<2)+(c<<3)|0;if(0!==p&&15!==p)switch(p){case 0:u.push([t-.5,e-.5]);break;case 1:u.push([t-.25-.25*(n+r-2*h)/(r-n),e-.25-.25*(i+r-2*h)/(r-i)]);break;case 2:u.push([t-.75-.25*(-n-r+2*h)/(n-r),e-.25-.25*(a+n-2*h)/(n-a)]);break;case 3:u.push([t-.5,e-.5-.5*(i+r+a+n-4*h)/(r-i+n-a)]);break;case 4:u.push([t-.25-.25*(a+i-2*h)/(i-a),e-.75-.25*(-i-r+2*h)/(i-r)]);break;case 5:u.push([t-.5-.5*(n+r+a+i-4*h)/(r-n+i-a),e-.5]);break;case 6:u.push([t-.5-.25*(-n-r+a+i)/(n-r+i-a),e-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:u.push([t-.75-.25*(a+i-2*h)/(i-a),e-.75-.25*(a+n-2*h)/(n-a)]);break;case 8:u.push([t-.75-.25*(-a-i+2*h)/(a-i),e-.75-.25*(-a-n+2*h)/(a-n)]);break;case 9:u.push([t-.5-.25*(n+r+-a-i)/(r-n+a-i),e-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:u.push([t-.5-.5*(-n-r-a-i+4*h)/(n-r+a-i),e-.5]);break;case 11:u.push([t-.25-.25*(-a-i+2*h)/(a-i),e-.75-.25*(i+r-2*h)/(r-i)]);break;case 12:u.push([t-.5,e-.5-.5*(-i-r-a-n+4*h)/(i-r+a-n)]);break;case 13:u.push([t-.75-.25*(n+r-2*h)/(r-n),e-.25-.25*(-a-n+2*h)/(a-n)]);break;case 14:u.push([t-.25-.25*(-n-r+2*h)/(n-r),e-.25-.25*(-i-r+2*h)/(i-r)]);break;case 15:u.push([t-.5,e-.5])}},cell:function(t,e,r,n,i,a,o,s,l){i?s.push([t,e]):s.push([e,t])}});return function(t,e){var r=[],i=[];return n(t,r,i,e),{positions:r,cells:i}}}};var o={}},{\"ndarray-extract-contour\":251,\"zero-crossings\":318}],303:[function(t,e,r){(function(r){(function(){\"use strict\";e.exports=function t(e,r,i){i=i||{};var o=a[e];o||(o=a[e]={\" \":{data:new Float32Array(0),shape:.2}});var s=o[r];if(!s)if(r.length<=1||!/\\d/.test(r))s=o[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o0&&(f+=.02);var p=new Float32Array(u),d=0,m=-.5*f;for(h=0;hMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function h(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var p=h.prototype;p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),u=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,u+=r[a]*r[a],e[a]/=l;var f=Math.sqrt(u);for(a=0;a<3;++a)r[a]/=f;var h=this.computedToward;o(h,e,r),s(h,h);var p=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(d),v=Math.sin(d),y=Math.cos(m),x=Math.sin(m),b=this.computedCenter,_=g*y,w=v*y,T=x,k=-g*x,A=-v*x,M=y,S=this.computedEye,E=this.computedMatrix;for(a=0;a<3;++a){var L=_*r[a]+w*h[a]+T*e[a];E[4*a+1]=k*r[a]+A*h[a]+M*e[a],E[4*a+2]=L,E[4*a+3]=0}var C=E[1],P=E[5],I=E[9],O=E[2],z=E[6],D=E[10],R=P*D-I*z,F=I*O-C*D,B=C*z-P*O,N=c(R,F,B);R/=N,F/=N,B/=N,E[0]=R,E[4]=F,E[8]=B;for(a=0;a<3;++a)S[a]=b[a]+E[2+4*a]*p;for(a=0;a<3;++a){u=0;for(var j=0;j<3;++j)u+=E[a+4*j]*S[j];E[12+a]=-u}E[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var d=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;d[0]=i[2],d[1]=i[6],d[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)i[4*c]=o[c],i[4*c+1]=s[c],i[4*c+2]=l[c];a(i,i,n,d);for(c=0;c<3;++c)o[c]=i[4*c],s[c]=i[4*c+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},p.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=c(a,o,s);a/=l,o/=l,s/=l;var u=i[0],f=i[4],h=i[8],p=u*a+f*o+h*s,d=c(u-=a*p,f-=o*p,h-=s*p),m=(u/=d)*e+a*r,g=(f/=d)*e+o*r,v=(h/=d)*e+s*r;this.center.move(t,m,g,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),this.radius.set(t,Math.log(y))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,n){var a=1;\"number\"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],f=e[a+8];if(n){var h=Math.abs(s),p=Math.abs(l),d=Math.abs(f),m=Math.max(h,p,d);h===m?(s=s<0?-1:1,l=f=0):d===m?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var g=c(s,l,f);s/=g,l/=g,f/=g}var v,y,x=e[o],b=e[o+4],_=e[o+8],w=x*s+b*l+_*f,T=c(x-=s*w,b-=l*w,_-=f*w),k=l*(_/=T)-f*(b/=T),A=f*(x/=T)-s*_,M=s*b-l*x,S=c(k,A,M);if(k/=S,A/=S,M/=S,this.center.jump(t,q,G,Y),this.radius.idle(t),this.up.jump(t,s,l,f),this.right.jump(t,x,b,_),2===a){var E=e[1],L=e[5],C=e[9],P=E*x+L*b+C*_,I=E*k+L*A+C*M;v=R<0?-Math.PI/2:Math.PI/2,y=Math.atan2(I,P)}else{var O=e[2],z=e[6],D=e[10],R=O*s+z*l+D*f,F=O*x+z*b+D*_,B=O*k+z*A+D*M;v=Math.asin(u(R)),y=Math.atan2(B,F)}this.angle.jump(t,y,v),this.recalcMatrix(t);var N=e[2],j=e[6],U=e[10],V=this.computedMatrix;i(V,e);var H=V[15],q=V[12]/H,G=V[13]/H,Y=V[14]/H,W=Math.exp(this.computedRadius[0]);this.center.jump(t,q-N*W,G-j*W,Y-U*W)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=c(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],p=c(l,f,h);if(!(p<1e-6)){l/=p,f/=p,h/=p;var d=this.computedRight,m=d[0],g=d[1],v=d[2],y=i*m+a*g+o*v,x=c(m-=y*i,g-=y*a,v-=y*o);if(!(x<.01&&(x=c(m=a*h-o*f,g=o*l-i*h,v=i*f-a*l))<1e-6)){m/=x,g/=x,v/=x,this.up.set(t,i,a,o),this.right.set(t,m,g,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(p));var b=a*v-o*g,_=o*m-i*v,w=i*g-a*m,T=c(b,_,w),k=i*l+a*f+o*h,A=m*l+g*f+v*h,M=(b/=T)*l+(_/=T)*f+(w/=T)*h,S=Math.asin(u(k)),E=Math.atan2(M,A),L=this.angle._state,C=L[L.length-1],P=L[L.length-2];C%=2*Math.PI;var I=Math.abs(C+2*Math.PI-E),O=Math.abs(C-E),z=Math.abs(C-2*Math.PI-E);I0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(p(t),0,t)}function m(t){return new Uint16Array(p(2*t),0,t)}function g(t){return new Uint32Array(p(4*t),0,t)}function v(t){return new Int8Array(p(t),0,t)}function y(t){return new Int16Array(p(2*t),0,t)}function x(t){return new Int32Array(p(4*t),0,t)}function b(t){return new Float32Array(p(4*t),0,t)}function _(t){return new Float64Array(p(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(p(t),0,t):d(t)}function T(t){return s?new BigUint64Array(p(8*t),0,t):null}function k(t){return l?new BigInt64Array(p(8*t),0,t):null}function A(t){return new DataView(p(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new a(t)}r.free=function(t){if(a.isBuffer(t))f[n.log2(t.length)].push(t);else{if(\"[object ArrayBuffer]\"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);u[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){h(t.buffer)},r.freeArrayBuffer=h,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||\"arraybuffer\"===e)return p(t);switch(e){case\"uint8\":return d(t);case\"uint16\":return m(t);case\"uint32\":return g(t);case\"int8\":return v(t);case\"int16\":return y(t);case\"int32\":return x(t);case\"float\":case\"float32\":return b(t);case\"double\":case\"float64\":return _(t);case\"uint8_clamped\":return w(t);case\"bigint64\":return k(t);case\"biguint64\":return T(t);case\"buffer\":return M(t);case\"data\":case\"dataview\":return A(t);default:return null}return null},r.mallocArrayBuffer=p,r.mallocUint8=d,r.mallocUint16=m,r.mallocUint32=g,r.mallocInt8=v,r.mallocInt16=y,r.mallocInt32=x,r.mallocFloat32=r.mallocFloat=b,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=T,r.mallocBigInt64=k,r.mallocDataView=A,r.mallocBuffer=M,r.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,f[t].length=0}}).call(this)}).call(this,void 0!==n?n:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{\"bit-twiddle\":32,buffer:3,dup:65}],309:[function(t,e,r){\"use strict\";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts));return r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+\"px\",n.font].filter((function(t){return t})).join(\" \"),r.textAlign=\"start\",r.textBaseline=\"alphabetic\",r.direction=\"ltr\",h(function(t,e,r,n,a,o){r=r.replace(/\\n/g,\"\"),r=!0===o.breaklines?r.replace(/\\
/g,\"\\n\"):r.replace(/\\
/g,\" \");var s=\"\",l=[];for(p=0;p-1?parseInt(t[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(S(),\"?px \"),g*=Math.pow(.75,l-s),n=n.replace(\"?px \",S())),m+=.25*x*(l-s)}if(!0===o.superscripts){var c=t.indexOf(\"+\"),u=r.indexOf(\"+\"),f=c>-1?parseInt(t[1+c]):0,h=u>-1?parseInt(r[1+u]):0;f!==h&&(n=n.replace(S(),\"?px \"),g*=Math.pow(.75,h-f),n=n.replace(\"?px \",S())),m-=.25*x*(h-f)}if(!0===o.bolds){var p=t.indexOf(\"b|\")>-1,d=r.indexOf(\"b|\")>-1;!p&&d&&(n=v?n.replace(\"italic \",\"italic bold \"):\"bold \"+n),p&&!d&&(n=n.replace(\"bold \",\"\"))}if(!0===o.italics){var v=t.indexOf(\"i|\")>-1,y=r.indexOf(\"i|\")>-1;!v&&y&&(n=\"italic \"+n),v&&!y&&(n=n.replace(\"italic \",\"\"))}e.font=n}for(h=0;h\",a=\"\"+t+\">\",o=i.length,s=a.length,l=\"+\"===e[0]||\"-\"===e[0],c=0,u=-s;c>-1&&-1!==(c=r.indexOf(i,c))&&-1!==(u=r.indexOf(a,c+o))&&!(u<=c);){for(var f=c;f=u)n[f]=null,r=r.substr(0,f)+\" \"+r.substr(f+1);else if(null!==n[f]){var h=n[f].indexOf(e[0]);-1===h?n[f]+=e:l&&(n[f]=n[f].substr(0,h+1)+(1+parseInt(n[f][h+1]))+n[f].substr(h+2))}var p=c+o,d=r.substr(p,u-p).indexOf(i);c=-1!==d?d:u+s}return n}function u(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function f(t,e,r,n){var i=u(t,n),a=function(t,e,r){for(var n=e.textAlign||\"start\",i=e.textBaseline||\"alphabetic\",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l=0?e[a]:i}))},has___:{value:y((function(e){var n=v(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:y((function(n,i){var a,o=v(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this}))},delete___:{value:y((function(n){var i,a,o=v(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0)&&(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,!0)}))}})};d.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),\"function\"==typeof r?function(){function n(){this instanceof d||x();var e,n=new r,i=void 0,a=!1;return e=t?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new d),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new d),i.set___(t,e)}else n.set(t,e);return this},Object.create(d.prototype,{get___:{value:y((function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)}))},has___:{value:y((function(t){return n.has(t)||!!i&&i.has___(t)}))},set___:{value:y(e)},delete___:{value:y((function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e}))},permitHostObjects___:{value:y((function(t){if(t!==m)throw new Error(\"bogus call to permitHostObjects___\");a=!0}))}})}t&&\"undefined\"!=typeof Proxy&&(Proxy=void 0),n.prototype=d.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,\"constructor\",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(\"undefined\"!=typeof Proxy&&(Proxy=void 0),e.exports=d)}function m(t){t.permitHostObjects___&&t.permitHostObjects___(m)}function g(t){return!(\"weakmap:\"==t.substr(0,\"weakmap:\".length)&&\"___\"===t.substr(t.length-3))}function v(t){if(t!==Object(t))throw new TypeError(\"Not an object: \"+t);var e=t[l];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,l,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function y(t){return t.prototype=null,Object.freeze(t)}function x(){h||\"undefined\"==typeof console||(h=!0,console.warn(\"WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future.\"))}}()},{}],314:[function(t,e,r){var n=t(\"./hidden-store.js\");e.exports=function(){var t={};return function(e){if((\"object\"!=typeof e||null===e)&&\"function\"!=typeof e)throw new Error(\"Weakmap-shim: Key must be object\");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},{\"./hidden-store.js\":315}],315:[function(t,e,r){e.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,\"valueOf\",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},{}],316:[function(t,e,r){var n=t(\"./create-store.js\");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty(\"value\")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return\"value\"in t(e)},delete:function(e){return delete t(e).value}}}},{\"./create-store.js\":314}],317:[function(t,e,r){\"use strict\";var n,i=function(){return function(t,e,r,n,i,a){var o=t[0],s=r[0],l=[0],c=s;n|=0;var u=0,f=s;for(u=0;u=0!=p>=0&&i.push(l[0]+.5+.5*(h+p)/(h-p)),n+=f,++l[0]}}};e.exports=(n={funcName:{funcName:\"zeroCrossings\"}.funcName},function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=[a,o.join()].join(),l=e[s];return l||(e[s]=l=t([a,o])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,i)}}(i.bind(void 0,n)))},{}],318:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t(\"./lib/zc-core\")},{\"./lib/zc-core\":317}]},{},[6])(6)}))}).call(this)}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[27])(27)}));