summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Struwig <mnicstruwig@gmail.com>2024-02-08 12:09:30 +0200
committerGitHub <noreply@github.com>2024-02-08 10:09:30 +0000
commitd4ac2fe27b76f34f5b4189021f13f750ae951b73 (patch)
tree742d2cb187edd2bea47691779f654cc54d90090b
parent7c68832379bf9869517114732d2888f5e10c436a (diff)
Add LLM tools example notebook (#6053)
* Add LLM tools example notebook * Update README, rename example notebook --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
-rw-r--r--examples/README.md9
-rw-r--r--examples/openbbPlatformAsLLMTools.ipynb6225
2 files changed, 6234 insertions, 0 deletions
diff --git a/examples/README.md b/examples/README.md
index 9c3be4b3283..484cf64f42c 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -47,3 +47,12 @@ This notebook explains how to calculate and plot the Copper-to-Gold ratio.
- Getting the historical series from FRED for the 10-year constant maturity US treasury bill.
- Performing basic DataFrame operations.
- Creating charts with Plotly Graph Objects.
+
+### openbbPlatformAsLLMTools
+
+This notebook shows you how you can use OpenbB Platform as functions in an LLM by leveraging function calling.
+
+- Create an LLM tool from an OpenBB Platform function
+- Convert all OpenBB Platform functions to LLM tools
+- Build a basic Langchain agent that can utilize function calling
+- Run the agent
diff --git a/examples/openbbPlatformAsLLMTools.ipynb b/examples/openbbPlatformAsLLMTools.ipynb
new file mode 100644
index 00000000000..f0d16553265
--- /dev/null
+++ b/examples/openbbPlatformAsLLMTools.ipynb
@@ -0,0 +1,6225 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# OpenBB Tools"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Getting Started"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Install dependencies"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "!pip install openbb\n",
+ "!pip install openbb-charting\n",
+ "\n",
+ "!pip install pydantic==2.5\n",
+ "\n",
+ "!pip install langchain\n",
+ "!pip install langchain_community\n",
+ "!pip install langchain_openai\n",
+ "# need to restart runtime after installing pydantic"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Set the OpenAI API Key"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import os\n",
+ "os.environ['OPENAI_API_KEY'] = \"your-api-key"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Import packages"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "from openbb import obb"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Login"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "obb.account.login(pat=\"PAT\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## OpenBB tool pre-requisites"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Callable"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "<div>\n",
+ "<style scoped>\n",
+ " .dataframe tbody tr th:only-of-type {\n",
+ " vertical-align: middle;\n",
+ " }\n",
+ "\n",
+ " .dataframe tbody tr th {\n",
+ " vertical-align: top;\n",
+ " }\n",
+ "\n",
+ " .dataframe thead th {\n",
+ " text-align: right;\n",
+ " }\n",
+ "</style>\n",
+ "<table border=\"1\" class=\"dataframe\">\n",
+ " <thead>\n",
+ " <tr style=\"text-align: right;\">\n",
+ " <th></th>\n",
+ " <th>open</th>\n",
+ " <th>high</th>\n",
+ " <th>low</th>\n",
+ " <th>close</th>\n",
+ " <th>volume</th>\n",
+ " <th>vwap</th>\n",
+ " <th>transactions</th>\n",
+ " </tr>\n",
+ " <tr>\n",
+ " <th>date</th>\n",
+ " <th></th>\n",
+ " <th></th>\n",
+ " <th></th>\n",
+ " <th></th>\n",
+ " <th></th>\n",
+ " <th></th>\n",
+ " <th></th>\n",
+ " </tr>\n",
+ " </thead>\n",
+ " <tbody>\n",
+ " <tr>\n",
+ " <th>2023-02-07</th>\n",
+ " <td>150.640</td>\n",
+ " <td>155.2300</td>\n",
+ " <td>150.6400</td>\n",
+ " <td>154.65</td>\n",
+ " <td>83322551.0</td>\n",
+ " <td>153.4202</td>\n",
+ " <td>661767</td>\n",
+ " </tr>\n",
+ " <tr>\n",
+ " <th>2023-02-08</th>\n",
+ " <td>153.880</td>\n",
+ " <td>154.5800</td>\n",
+ " <td>151.1680</td>\n",
+ " <td>151.92</td>\n",
+ " <td>63620079.0</td>\n",
+ " <td>152.3636</td>\n",
+ " <td>524140</td>\n",
+ " </tr>\n",
+ " <tr>\n",
+ " <th>2023-02-09</th>\n",
+ " <td>153.775</td>\n",
+ " <td>154.3300</td>\n",
+ " <td>150.4200</td>\n",
+ " <td>150.87</td>\n",
+ " <td>55994243.0</td>\n",
+ " <td>152.2769</td>\n",
+ " <td>471973</td>\n",
+ " </tr>\n",
+ " <tr>\n",
+ " <th>2023-02-10</th>\n",
+ " <td>149.460</td>\n",
+ " <td>151.3401</td>\n",
+ " <td>149.2200</td>\n",
+ " <td>151.01</td>\n",
+ " <td>57388108.0</td>\n",
+ " <td>150.4054</td>\n",
+ " <td>443405</td>\n",
+ " </tr>\n",
+ " <tr>\n",
+ " <th>2023-02-13</th>\n",
+ " <td>150.952</td>\n",
+ " <td>154.2600</td>\n",
+ " <td>150.9200</td>\n",
+ " <td>153.85</td>\n",
+ " <td>62199013.0</td>\n",
+ " <td>153.2310</td>\n",
+ " <td>506668</td>\n",
+ " </tr>\n",
+ " <tr>\n",
+ " <th>...</th>\n",
+ " <td>...</td>\n",
+ " <td>...</td>\n",
+ " <td>...</td>\n",
+ " <td>...</td>\n",
+ " <td>...</td>\n",
+ " <td>...</td>\n",
+ " <td>...</td>\n",
+ " </tr>\n",
+ " <tr>\n",
+ " <th>2024-02-01</th>\n",
+ " <td>183.985</td>\n",
+ " <td>186.9500</td>\n",
+ " <td>183.8200</td>\n",
+ " <td>186.86</td>\n",
+ " <td>64885408.0</td>\n",
+ " <td>185.5688</td>\n",
+ " <td>820977</td>\n",
+ " </tr>\n",
+ " <tr>\n",
+ " <th>2024-02-02</th>\n",
+ " <td>179.860</td>\n",
+ " <td>187.3300</td>\n",
+ " <td>179.2500</td>\n",
+ " <td>185.85</td>\n",
+ " <td>102527680.0</td>\n",
+ " <td>184.7440</td>\n",
+ " <td>1108465</td>\n",
+ " </tr>\n",
+ " <tr>\n",
+ " <th>2024-02-05</th>\n",
+ " <td>188.150</td>\n",
+ " <td>189.2500</td>\n",
+ " <td>185.8400</td>\n",
+ " <td>187.68</td>\n",
+ " <td>69654320.0</td>\n",
+ " <td>187.6824</td>\n",
+ " <td>804748</td>\n",
+ " </tr>\n",
+ " <tr>\n",
+ " <th>2024-02-06</th>\n",
+ " <td>186.860</td>\n",
+ " <td>189.3100</td>\n",
+ " <td>186.7695</td>\n",
+ " <td>189.30</td>\n",
+ " <td>43490528.0</td>\n",
+ " <td>188.4788</td>\n",
+ " <td>530823</td>\n",
+ " </tr>\n",
+ " <tr>\n",
+ " <th>2024-02-07</th>\n",
+ " <td>190.630</td>\n",
+ " <td>191.0500</td>\n",
+ " <td>188.6100</td>\n",
+ " <td>189.00</td>\n",
+ " <td>31515523.0</td>\n",
+ " <td>189.4285</td>\n",
+ " <td>474967</td>\n",
+ " </tr>\n",
+ " </tbody>\n",
+ "</table>\n",
+ "<p>252 rows × 7 columns</p>\n",
+ "</div>"
+ ],
+ "text/plain": [
+ " open high low close volume vwap \\\n",
+ "date \n",
+ "2023-02-07 150.640 155.2300 150.6400 154.65 83322551.0 153.4202 \n",
+ "2023-02-08 153.880 154.5800 151.1680 151.92 63620079.0 152.3636 \n",
+ "2023-02-09 153.775 154.3300 150.4200 150.87 55994243.0 152.2769 \n",
+ "2023-02-10 149.460 151.3401 149.2200 151.01 57388108.0 150.4054 \n",
+ "2023-02-13 150.952 154.2600 150.9200 153.85 62199013.0 153.2310 \n",
+ "... ... ... ... ... ... ... \n",
+ "2024-02-01 183.985 186.9500 183.8200 186.86 64885408.0 185.5688 \n",
+ "2024-02-02 179.860 187.3300 179.2500 185.85 102527680.0 184.7440 \n",
+ "2024-02-05 188.150 189.2500 185.8400 187.68 69654320.0 187.6824 \n",
+ "2024-02-06 186.860 189.3100 186.7695 189.30 43490528.0 188.4788 \n",
+ "2024-02-07 190.630 191.0500 188.6100 189.00 31515523.0 189.4285 \n",
+ "\n",
+ " transactions \n",
+ "date \n",
+ "2023-02-07 661767 \n",
+ "2023-02-08 524140 \n",
+ "2023-02-09 471973 \n",
+ "2023-02-10 443405 \n",
+ "2023-02-13 506668 \n",
+ "... ... \n",
+ "2024-02-01 820977 \n",
+ "2024-02-02 1108465 \n",
+ "2024-02-05 804748 \n",
+ "2024-02-06 530823 \n",
+ "2024-02-07 474967 \n",
+ "\n",
+ "[252 rows x 7 columns]"
+ ]
+ },
+ "execution_count": 2,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "obb.equity.price.historical(symbol=\"AAPL\", provider=\"polygon\").to_df()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ " <script type=\"text/javascript\">\n",
+ " window.PlotlyConfig = {MathJaxConfig: 'local'};\n",
+ " if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n",
+ " if (typeof require !== 'undefined') {\n",
+ " require.undef(\"plotly\");\n",
+ " define('plotly', function(require, exports, module) {\n",
+ " /**\n",
+ "* plotly.js v2.27.0\n",
+ "* Copyright 2012-2023, Plotly, Inc.\n",
+ "* All rights reserved.\n",
+ "* Licensed under the MIT license\n",
+ "*/\n",
+ "/*! For license information please see plotly.min.js.LICENSE.txt */\n",
+ "!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.Plotly=e():t.Plotly=e()}(self,(function(){return function(){var t={98847:function(t,e,r){\"use strict\";var n=r(71828),i={\"X,X div\":'direction:ltr;font-family:\"Open Sans\",verdana,arial,sans-serif;margin:0;padding:0;',\"X input,X button\":'font-family:\"Open Sans\",verdana,arial,sans-serif;',\"X input:focus,X button:focus\":\"outline:none;\",\"X a\":\"text-decoration:none;\",\"X a:hover\":\"text-decoration:none;\",\"X .crisp\":\"shape-rendering:crispEdges;\",\"X .user-select-none\":\"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;\",\"X svg\":\"overflow:hidden;\",\"X svg a\":\"fill:#447adb;\",\"X svg a:hover\":\"fill:#3c6dc5;\",\"X .main-svg\":\"position:absolute;top:0;left:0;pointer-events:none;\",\"X .main-svg .draglayer\":\"pointer-events:all;\",\"X .cursor-default\":\"cursor:default;\",\"X .cursor-pointer\":\"cursor:pointer;\",\"X .cursor-crosshair\":\"cursor:crosshair;\",\"X .cursor-move\":\"cursor:move;\",\"X .cursor-col-resize\":\"cursor:col-resize;\",\"X .cursor-row-resize\":\"cursor:row-resize;\",\"X .cursor-ns-resize\":\"cursor:ns-resize;\",\"X .cursor-ew-resize\":\"cursor:ew-resize;\",\"X .cursor-sw-resize\":\"cursor:sw-resize;\",\"X .cursor-s-resize\":\"cursor:s-resize;\",\"X .cursor-se-resize\":\"cursor:se-resize;\",\"X .cursor-w-resize\":\"cursor:w-resize;\",\"X .cursor-e-resize\":\"cursor:e-resize;\",\"X .cursor-nw-resize\":\"cursor:nw-resize;\",\"X .cursor-n-resize\":\"cursor:n-resize;\",\"X .cursor-ne-resize\":\"cursor:ne-resize;\",\"X .cursor-grab\":\"cursor:-webkit-grab;cursor:grab;\",\"X .modebar\":\"position:absolute;top:2px;right:2px;\",\"X .ease-bg\":\"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;\",\"X .modebar--hover>:not(.watermark)\":\"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;\",\"X:hover .modebar--hover .modebar-group\":\"opacity:1;\",\"X .modebar-group\":\"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;\",\"X .modebar-btn\":\"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;\",\"X .modebar-btn svg\":\"position:relative;top:2px;\",\"X .modebar.vertical\":\"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;\",\"X .modebar.vertical svg\":\"top:-1px;\",\"X .modebar.vertical .modebar-group\":\"display:block;float:none;padding-left:0px;padding-bottom:8px;\",\"X .modebar.vertical .modebar-group .modebar-btn\":\"display:block;text-align:center;\",\"X [data-title]:before,X [data-title]:after\":\"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;\",\"X [data-title]:hover:before,X [data-title]:hover:after\":\"display:block;opacity:1;\",\"X [data-title]:before\":'content:\"\";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',\"X [data-title]:after\":\"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;\",\"X .vertical [data-title]:before,X .vertical [data-title]:after\":\"top:0%;right:200%;\",\"X .vertical [data-title]:before\":\"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;\",Y:'font-family:\"Open Sans\",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',\"Y p\":\"margin:0;\",\"Y .notifier-note\":\"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;\",\"Y .notifier-close\":\"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;\",\"Y .notifier-close:hover\":\"color:#444;text-decoration:none;cursor:pointer;\"};for(var a in i){var o=a.replace(/^,/,\" ,\").replace(/X/g,\".js-plotly-plot .plotly\").replace(/Y/g,\".plotly-notifier\");n.addStyleRule(o,i[a])}},98222:function(t,e,r){\"use strict\";t.exports=r(82887)},27206:function(t,e,r){\"use strict\";t.exports=r(60822)},59893:function(t,e,r){\"use strict\";t.exports=r(23381)},5224:function(t,e,r){\"use strict\";t.exports=r(83832)},59509:function(t,e,r){\"use strict\";t.exports=r(72201)},75557:function(t,e,r){\"use strict\";t.exports=r(91815)},40338:function(t,e,r){\"use strict\";t.exports=r(21462)},35080:function(t,e,r){\"use strict\";t.exports=r(51319)},61396:function(t,e,r){\"use strict\";t.exports=r(57516)},40549:function(t,e,r){\"use strict\";t.exports=r(98128)},49866:function(t,e,r){\"use strict\";t.exports=r(99442)},36089:function(t,e,r){\"use strict\";t.exports=r(93740)},19548:function(t,e,r){\"use strict\";t.exports=r(8729)},35831:function(t,e,r){\"use strict\";t.exports=r(93814)},61039:function(t,e,r){\"use strict\";t.exports=r(14382)},97040:function(t,e,r){\"use strict\";t.exports=r(51759)},77986:function(t,e,r){\"use strict\";t.exports=r(10421)},24296:function(t,e,r){\"use strict\";t.exports=r(43102)},58872:function(t,e,r){\"use strict\";t.exports=r(92165)},29626:function(t,e,r){\"use strict\";t.exports=r(3325)},65591:function(t,e,r){\"use strict\";t.exports=r(36071)},69738:function(t,e,r){\"use strict\";t.exports=r(43905)},92650:function(t,e,r){\"use strict\";t.exports=r(35902)},35630:function(t,e,r){\"use strict\";t.exports=r(69816)},73434:function(t,e,r){\"use strict\";t.exports=r(94507)},27909:function(t,e,r){\"use strict\";var n=r(19548);n.register([r(27206),r(5224),r(58872),r(65591),r(69738),r(92650),r(49866),r(25743),r(6197),r(97040),r(85461),r(73434),r(54201),r(81299),r(47645),r(35630),r(77986),r(83043),r(93005),r(96881),r(4534),r(50581),r(40549),r(77900),r(47582),r(35080),r(21641),r(17280),r(5861),r(29626),r(10021),r(65317),r(96268),r(61396),r(35831),r(16122),r(46163),r(40344),r(40338),r(48131),r(36089),r(55334),r(75557),r(19440),r(99488),r(59893),r(97393),r(98222),r(61039),r(24296),r(66398),r(59509)]),t.exports=n},46163:function(t,e,r){\"use strict\";t.exports=r(15154)},96881:function(t,e,r){\"use strict\";t.exports=r(64943)},50581:function(t,e,r){\"use strict\";t.exports=r(21164)},55334:function(t,e,r){\"use strict\";t.exports=r(54186)},65317:function(t,e,r){\"use strict\";t.exports=r(94873)},10021:function(t,e,r){\"use strict\";t.exports=r(67618)},54201:function(t,e,r){\"use strict\";t.exports=r(58810)},5861:function(t,e,r){\"use strict\";t.exports=r(20593)},16122:function(t,e,r){\"use strict\";t.exports=r(29396)},83043:function(t,e,r){\"use strict\";t.exports=r(13551)},48131:function(t,e,r){\"use strict\";t.exports=r(46858)},47582:function(t,e,r){\"use strict\";t.exports=r(17988)},21641:function(t,e,r){\"use strict\";t.exports=r(68868)},96268:function(t,e,r){\"use strict\";t.exports=r(20467)},19440:function(t,e,r){\"use strict\";t.exports=r(91271)},99488:function(t,e,r){\"use strict\";t.exports=r(21461)},97393:function(t,e,r){\"use strict\";t.exports=r(85956)},25743:function(t,e,r){\"use strict\";t.exports=r(52979)},66398:function(t,e,r){\"use strict\";t.exports=r(32275)},17280:function(t,e,r){\"use strict\";t.exports=r(6419)},77900:function(t,e,r){\"use strict\";t.exports=r(61510)},81299:function(t,e,r){\"use strict\";t.exports=r(87619)},93005:function(t,e,r){\"use strict\";t.exports=r(93601)},40344:function(t,e,r){\"use strict\";t.exports=r(96595)},47645:function(t,e,r){\"use strict\";t.exports=r(70954)},6197:function(t,e,r){\"use strict\";t.exports=r(47462)},4534:function(t,e,r){\"use strict\";t.exports=r(17659)},85461:function(t,e,r){\"use strict\";t.exports=r(19990)},82884:function(t){\"use strict\";t.exports=[{path:\"\",backoff:0},{path:\"M-2.4,-3V3L0.6,0Z\",backoff:.6},{path:\"M-3.7,-2.5V2.5L1.3,0Z\",backoff:1.3},{path:\"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z\",backoff:1.55},{path:\"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z\",backoff:1.6},{path:\"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z\",backoff:2},{path:\"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z\",backoff:0,noRotate:!0},{path:\"M2,2V-2H-2V2Z\",backoff:0,noRotate:!0}]},50215:function(t,e,r){\"use strict\";var n=r(82884),i=r(41940),a=r(85555),o=r(44467).templatedArray;r(24695),t.exports=o(\"annotation\",{visible:{valType:\"boolean\",dflt:!0,editType:\"calc+arraydraw\"},text:{valType:\"string\",editType:\"calc+arraydraw\"},textangle:{valType:\"angle\",dflt:0,editType:\"calc+arraydraw\"},font:i({editType:\"calc+arraydraw\",colorEditType:\"arraydraw\"}),width:{valType:\"number\",min:1,dflt:null,editType:\"calc+arraydraw\"},height:{valType:\"number\",min:1,dflt:null,editType:\"calc+arraydraw\"},opacity:{valType:\"number\",min:0,max:1,dflt:1,editType:\"arraydraw\"},align:{valType:\"enumerated\",values:[\"left\",\"center\",\"right\"],dflt:\"center\",editType:\"arraydraw\"},valign:{valType:\"enumerated\",values:[\"top\",\"middle\",\"bottom\"],dflt:\"middle\",editType:\"arraydraw\"},bgcolor:{valType:\"color\",dflt:\"rgba(0,0,0,0)\",editType:\"arraydraw\"},bordercolor:{valType:\"color\",dflt:\"rgba(0,0,0,0)\",editType:\"arraydraw\"},borderpad:{valType:\"number\",min:0,dflt:1,editType:\"calc+arraydraw\"},borderwidth:{valType:\"number\",min:0,dflt:1,editType:\"calc+arraydraw\"},showarrow:{valType:\"boolean\",dflt:!0,editType:\"calc+arraydraw\"},arrowcolor:{valType:\"color\",editType:\"arraydraw\"},arrowhead:{valType:\"integer\",min:0,max:n.length,dflt:1,editType:\"arraydraw\"},startarrowhead:{valType:\"integer\",min:0,max:n.length,dflt:1,editType:\"arraydraw\"},arrowside:{valType:\"flaglist\",flags:[\"end\",\"start\"],extras:[\"none\"],dflt:\"end\",editType:\"arraydraw\"},arrowsize:{valType:\"number\",min:.3,dflt:1,editType:\"calc+arraydraw\"},startarrowsize:{valType:\"number\",min:.3,dflt:1,editType:\"calc+arraydraw\"},arrowwidth:{valType:\"number\",min:.1,editType:\"calc+arraydraw\"},standoff:{valType:\"number\",min:0,dflt:0,editType:\"calc+arraydraw\"},startstandoff:{valType:\"number\",min:0,dflt:0,editType:\"calc+arraydraw\"},ax:{valType:\"any\",editType:\"calc+arraydraw\"},ay:{valType:\"any\",editType:\"calc+arraydraw\"},axref:{valType:\"enumerated\",dflt:\"pixel\",values:[\"pixel\",a.idRegex.x.toString()],editType:\"calc\"},ayref:{valType:\"enumerated\",dflt:\"pixel\",values:[\"pixel\",a.idRegex.y.toString()],editType:\"calc\"},xref:{valType:\"enumerated\",values:[\"paper\",a.idRegex.x.toString()],editType:\"calc\"},x:{valType:\"any\",editType:\"calc+arraydraw\"},xanchor:{valType:\"enumerated\",values:[\"auto\",\"left\",\"center\",\"right\"],dflt:\"auto\",editType:\"calc+arraydraw\"},xshift:{valType:\"number\",dflt:0,editType:\"calc+arraydraw\"},yref:{valType:\"enumerated\",values:[\"paper\",a.idRegex.y.toString()],editType:\"calc\"},y:{valType:\"any\",editType:\"calc+arraydraw\"},yanchor:{valType:\"enumerated\",values:[\"auto\",\"top\",\"middle\",\"bottom\"],dflt:\"auto\",editType:\"calc+arraydraw\"},yshift:{valType:\"number\",dflt:0,editType:\"calc+arraydraw\"},clicktoshow:{valType:\"enumerated\",values:[!1,\"onoff\",\"onout\"],dflt:!1,editType:\"arraydraw\"},xclick:{valType:\"any\",editType:\"arraydraw\"},yclick:{valType:\"any\",editType:\"arraydraw\"},hovertext:{valType:\"string\",editType:\"arraydraw\"},hoverlabel:{bgcolor:{valType:\"color\",editType:\"arraydraw\"},bordercolor:{valType:\"color\",editType:\"arraydraw\"},font:i({editType:\"arraydraw\"}),editType:\"arraydraw\"},captureevents:{valType:\"boolean\",editType:\"arraydraw\"},editType:\"calc\",_deprecated:{ref:{valType:\"string\",editType:\"calc\"}}})},3749:function(t,e,r){\"use strict\";var n=r(71828),i=r(89298),a=r(92605).draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref),a=i.getRefType(e.xref),o=i.getRefType(e.yref);e._extremes={},\"range\"===a&&s(e,r),\"range\"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t[\"a\"+a],l=t[a+\"ref\"],u=t[\"a\"+a+\"ref\"],c=t[\"_\"+a+\"padplus\"],f=t[\"_\"+a+\"padminus\"],h={x:1,y:-1}[a]*t[a+\"shift\"],p=3*t.arrowsize*t.arrowwidth||0,d=p+h,v=p-h,g=3*t.startarrowsize*t.arrowwidth||0,y=g+h,m=g-h;if(u===l){var x=i.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:v}),b=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,y),ppadminus:Math.max(f,m)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else y=s?y+s:y,m=s?m-s:m,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,d,y),ppadminus:Math.max(f,v,m)});t._extremes[n]=r}t.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},44317:function(t,e,r){\"use strict\";var n=r(71828),i=r(73972),a=r(44467).arrayEditor;function o(t,e){var r,n,i,a,o,l,u,c=t._fullLayout.annotations,f=[],h=[],p=[],d=(e||[]).length;for(r=0;r<c.length;r++)if(a=(i=c[r]).clicktoshow){for(n=0;n<d;n++)if(l=(o=e[n]).xaxis,u=o.yaxis,l._id===i.xref&&u._id===i.yref&&l.d2r(o.x)===s(i._xclick,l)&&u.d2r(o.y)===s(i._yclick,u)){(i.visible?\"onout\"===a?h:p:f).push(r);break}n===d&&i.visible&&\"onout\"===a&&h.push(r)}return{on:f,off:h,explicitOff:p}}function s(t,e){return\"log\"===e.type?e.l2r(t):e.d2r(t)}t.exports={hasClickToShow:function(t,e){var r=o(t,e);return r.on.length>0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(u.length||c.length){for(r=0;r<u.length;r++)(s=a(t.layout,\"annotations\",h[u[r]])).modifyItem(\"visible\",!0),n.extendFlat(f,s.getUpdateObj());for(r=0;r<c.length;r++)(s=a(t.layout,\"annotations\",h[c[r]])).modifyItem(\"visible\",!1),n.extendFlat(f,s.getUpdateObj());return i.call(\"update\",t,{},f)}}}},25625:function(t,e,r){\"use strict\";var n=r(71828),i=r(7901);t.exports=function(t,e,r,a){a(\"opacity\");var o=a(\"bgcolor\"),s=a(\"bordercolor\"),l=i.opacity(s);a(\"borderpad\");var u=a(\"borderwidth\"),c=a(\"showarrow\");if(a(\"text\",c?\" \":r._dfltTitle.annotation),a(\"textangle\"),n.coerceFont(a,\"font\",r.font),a(\"width\"),a(\"align\"),a(\"height\")&&a(\"valign\"),c){var f,h,p=a(\"arrowside\");-1!==p.indexOf(\"end\")&&(f=a(\"arrowhead\"),h=a(\"arrowsize\")),-1!==p.indexOf(\"start\")&&(a(\"startarrowhead\",f),a(\"startarrowsize\",h)),a(\"arrowcolor\",l?e.bordercolor:i.defaultLine),a(\"arrowwidth\",2*(l&&u||1)),a(\"standoff\"),a(\"startstandoff\")}var d=a(\"hovertext\"),v=r.hoverlabel||{};if(d){var g=a(\"hoverlabel.bgcolor\",v.bgcolor||(i.opacity(o)?i.rgb(o):i.defaultLine)),y=a(\"hoverlabel.bordercolor\",v.bordercolor||i.contrast(g));n.coerceFont(a,\"hoverlabel.font\",{family:v.font.family,size:v.font.size,color:v.font.color||y})}a(\"captureevents\",!!d)}},94128:function(t,e,r){\"use strict\";var n=r(92770),i=r(58163);t.exports=function(t,e,r,a){e=e||{};var o=\"log\"===r&&\"linear\"===e.type,s=\"linear\"===r&&\"log\"===e.type;if(o||s)for(var l,u,c=t._fullLayout.annotations,f=e._id.charAt(0),h=0;h<c.length;h++)l=c[h],u=\"annotations[\"+h+\"].\",l[f+\"ref\"]===e._id&&p(f),l[\"a\"+f+\"ref\"]===e._id&&p(\"a\"+f);function p(t){var r=l[t],s=null;s=o?i(r,e.range):Math.pow(10,r),n(s)||(s=null),a(u+t,s)}}},84046:function(t,e,r){\"use strict\";var n=r(71828),i=r(89298),a=r(85501),o=r(25625),s=r(50215);function l(t,e,r){function a(r,i){return n.coerce(t,e,s,r,i)}var l=a(\"visible\"),u=a(\"clicktoshow\");if(l||u){o(t,e,r,a);for(var c=e.showarrow,f=[\"x\",\"y\"],h=[-10,-30],p={_fullLayout:r},d=0;d<2;d++){var v=f[d],g=i.coerceRef(t,e,p,v,\"\",\"paper\");if(\"paper\"!==g&&i.getFromId(p,g)._annIndices.push(e._index),i.coercePosition(e,p,a,g,v,.5),c){var y=\"a\"+v,m=i.coerceRef(t,e,p,y,\"pixel\",[\"pixel\",\"paper\"]);\"pixel\"!==m&&m!==g&&(m=e[y]=\"pixel\");var x=\"pixel\"===m?h[d]:.4;i.coercePosition(e,p,a,m,y,x)}a(v+\"anchor\"),a(v+\"shift\")}if(n.noneOrAll(t,e,[\"x\",\"y\"]),c&&n.noneOrAll(t,e,[\"ax\",\"ay\"]),u){var b=a(\"xclick\"),_=a(\"yclick\");e._xclick=void 0===b?e.x:i.cleanPosition(b,p,e.xref),e._yclick=void 0===_?e.y:i.cleanPosition(_,p,e.yref)}}}t.exports=function(t,e){a(t,e,{name:\"annotations\",handleItemDefaults:l})}},92605:function(t,e,r){\"use strict\";var n=r(39898),i=r(73972),a=r(74875),o=r(71828),s=o.strTranslate,l=r(89298),u=r(7901),c=r(91424),f=r(30211),h=r(63893),p=r(6964),d=r(28569),v=r(44467).arrayEditor,g=r(13011);function y(t,e){var r=t._fullLayout.annotations[e]||{},n=l.getFromId(t,r.xref),i=l.getFromId(t,r.yref);n&&n.setScale(),i&&i.setScale(),x(t,r,e,!1,n,i)}function m(t,e,r,n,i){var a=i[r],o=i[r+\"ref\"],s=-1!==r.indexOf(\"y\"),u=\"domain\"===l.getRefType(o),c=s?n.h:n.w;return t?u?a+(s?-e:e)/t._length:t.p2r(t.r2p(a)+e):a+(s?-e:e)/c}function x(t,e,r,a,y,x){var b,_,w=t._fullLayout,T=t._fullLayout._size,k=t._context.edits;a?(b=\"annotation-\"+a,_=a+\".annotations\"):(b=\"annotation\",_=\"annotations\");var A=v(t.layout,_,e),M=A.modifyBase,S=A.modifyItem,E=A.getUpdateObj;w._infolayer.selectAll(\".\"+b+'[data-index=\"'+r+'\"]').remove();var L=\"clip\"+w._uid+\"_ann\"+r;if(e._input&&!1!==e.visible){var C={x:{},y:{}},P=+e.textangle||0,O=w._infolayer.append(\"g\").classed(b,!0).attr(\"data-index\",String(r)).style(\"opacity\",e.opacity),I=O.append(\"g\").classed(\"annotation-text-g\",!0),D=k[e.showarrow?\"annotationTail\":\"annotationPosition\"],z=e.captureevents||k.annotationText||D,R=I.append(\"g\").style(\"pointer-events\",z?\"all\":null).call(p,\"pointer\").on(\"click\",(function(){t._dragging=!1,t.emit(\"plotly_clickannotation\",Z(n.event))}));e.hovertext&&R.on(\"mouseover\",(function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();f.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:t})})).on(\"mouseout\",(function(){f.loneUnhover(w._hoverlayer.node())}));var F=e.borderwidth,B=e.borderpad,N=F+B,j=R.append(\"rect\").attr(\"class\",\"bg\").style(\"stroke-width\",F+\"px\").call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor),U=e.width||e.height,V=w._topclips.selectAll(\"#\"+L).data(U?[0]:[]);V.enter().append(\"clipPath\").classed(\"annclip\",!0).attr(\"id\",L).append(\"rect\"),V.exit().remove();var H=e.font,q=w._meta?o.templateString(e.text,w._meta):e.text,G=R.append(\"text\").classed(\"annotation-text\",!0).text(q);k.annotationText?G.call(h.makeEditable,{delegate:R,gd:t}).call(Y).on(\"edit\",(function(r){e.text=r,this.call(Y),S(\"text\",r),y&&y.autorange&&M(y._name+\".autorange\",!0),x&&x.autorange&&M(x._name+\".autorange\",!0),i.call(\"_guiRelayout\",t,E())})):G.call(Y)}else n.selectAll(\"#\"+L).remove();function Z(t){var n={index:r,annotation:e._input,fullAnnotation:e,event:t};return a&&(n.subplotId=a),n}function Y(r){return r.call(c.font,H).attr({\"text-anchor\":{left:\"start\",right:\"end\"}[e.align]||\"middle\"}),h.convertToTspans(r,t,W),r}function W(){var r=G.selectAll(\"a\");1===r.size()&&r.text()===G.text()&&R.insert(\"a\",\":first-child\").attr({\"xlink:xlink:href\":r.attr(\"xlink:href\"),\"xlink:xlink:show\":r.attr(\"xlink:show\")}).style({cursor:\"pointer\"}).node().appendChild(j.node());var n=R.select(\".annotation-text-math-group\"),f=!n.empty(),v=c.bBox((f?n:G).node()),b=v.width,_=v.height,A=e.width||b,z=e.height||_,B=Math.round(A+2*N),H=Math.round(z+2*N);function q(t,e){return\"auto\"===e&&(e=t<1/3?\"left\":t>2/3?\"right\":\"center\"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var Y=!1,W=[\"x\",\"y\"],X=0;X<W.length;X++){var J,K,$,Q,tt,et=W[X],rt=e[et+\"ref\"]||et,nt=e[\"a\"+et+\"ref\"],it={x:y,y:x}[et],at=(P+(\"x\"===et?0:-90))*Math.PI/180,ot=B*Math.cos(at),st=H*Math.sin(at),lt=Math.abs(ot)+Math.abs(st),ut=e[et+\"anchor\"],ct=e[et+\"shift\"]*(\"x\"===et?1:-1),ft=C[et],ht=l.getRefType(rt);if(it&&\"domain\"!==ht){var pt=it.r2fraction(e[et]);(pt<0||pt>1)&&(nt===rt?((pt=it.r2fraction(e[\"a\"+et]))<0||pt>1)&&(Y=!0):Y=!0),J=it._offset+it.r2p(e[et]),Q=.5}else{var dt=\"domain\"===ht;\"x\"===et?($=e[et],J=dt?it._offset+it._length*$:J=T.l+T.w*$):($=1-e[et],J=dt?it._offset+it._length*$:J=T.t+T.h*$),Q=e.showarrow?.5:$}if(e.showarrow){ft.head=J;var vt=e[\"a\"+et];if(tt=ot*q(.5,e.xanchor)-st*q(.5,e.yanchor),nt===rt){var gt=l.getRefType(nt);\"domain\"===gt?(\"y\"===et&&(vt=1-vt),ft.tail=it._offset+it._length*vt):\"paper\"===gt?\"y\"===et?(vt=1-vt,ft.tail=T.t+T.h*vt):ft.tail=T.l+T.w*vt:ft.tail=it._offset+it.r2p(vt),K=tt}else ft.tail=J+vt,K=tt+vt;ft.text=ft.tail+tt;var yt=w[\"x\"===et?\"width\":\"height\"];if(\"paper\"===rt&&(ft.head=o.constrain(ft.head,1,yt-1)),\"pixel\"===nt){var mt=-Math.max(ft.tail-3,ft.text),xt=Math.min(ft.tail+3,ft.text)-yt;mt>0?(ft.tail+=mt,ft.text+=mt):xt>0&&(ft.tail-=xt,ft.text-=xt)}ft.tail+=ct,ft.head+=ct}else K=tt=lt*q(Q,ut),ft.text=J+tt;ft.text+=ct,tt+=ct,K+=ct,e[\"_\"+et+\"padplus\"]=lt/2+K,e[\"_\"+et+\"padminus\"]=lt/2-K,e[\"_\"+et+\"size\"]=lt,e[\"_\"+et+\"shift\"]=tt}if(Y)R.remove();else{var bt=0,_t=0;if(\"left\"!==e.align&&(bt=(A-b)*(\"center\"===e.align?.5:1)),\"top\"!==e.valign&&(_t=(z-_)*(\"middle\"===e.valign?.5:1)),f)n.select(\"svg\").attr({x:N+bt-1,y:N+_t}).call(c.setClipUrl,U?L:null,t);else{var wt=N+_t-v.top,Tt=N+bt-v.left;G.call(h.positionText,Tt,wt).call(c.setClipUrl,U?L:null,t)}V.select(\"rect\").call(c.setRect,N,N,A,z),j.call(c.setRect,F/2,F/2,B-F,H-F),R.call(c.setTranslate,Math.round(C.x.text-B/2),Math.round(C.y.text-H/2)),I.attr({transform:\"rotate(\"+P+\",\"+C.x.text+\",\"+C.y.text+\")\"});var kt,At=function(r,n){O.selectAll(\".annotation-arrow-g\").remove();var l=C.x.head,f=C.y.head,h=C.x.tail+r,p=C.y.tail+n,v=C.x.text+r,b=C.y.text+n,_=o.rotationXYMatrix(P,v,b),w=o.apply2DTransform(_),A=o.apply2DTransform2(_),L=+j.attr(\"width\"),D=+j.attr(\"height\"),z=v-.5*L,F=z+L,B=b-.5*D,N=B+D,U=[[z,B,z,N],[z,N,F,N],[F,N,F,B],[F,B,z,B]].map(A);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,p,l,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,p=e.y)}));var V=e.arrowwidth,H=e.arrowcolor,q=e.arrowside,G=O.append(\"g\").style({opacity:u.opacity(H)}).classed(\"annotation-arrow-g\",!0),Z=G.append(\"path\").attr(\"d\",\"M\"+h+\",\"+p+\"L\"+l+\",\"+f).style(\"stroke-width\",V+\"px\").call(u.stroke,u.rgb(H));if(g(Z,q,e),k.annotationPosition&&Z.node().parentNode&&!a){var Y=l,W=f;if(e.standoff){var X=Math.sqrt(Math.pow(l-h,2)+Math.pow(f-p,2));Y+=e.standoff*(h-l)/X,W+=e.standoff*(p-f)/X}var J,K,$=G.append(\"path\").classed(\"annotation-arrow\",!0).classed(\"anndrag\",!0).classed(\"cursor-move\",!0).attr({d:\"M3,3H-3V-3H3ZM0,0L\"+(h-Y)+\",\"+(p-W),transform:s(Y,W)}).style(\"stroke-width\",V+6+\"px\").call(u.stroke,\"rgba(0,0,0,0)\").call(u.fill,\"rgba(0,0,0,0)\");d.init({element:$.node(),gd:t,prepFn:function(){var t=c.getTranslate(R);J=t.x,K=t.y,y&&y.autorange&&M(y._name+\".autorange\",!0),x&&x.autorange&&M(x._name+\".autorange\",!0)},moveFn:function(t,r){var n=w(J,K),i=n[0]+t,a=n[1]+r;R.call(c.setTranslate,i,a),S(\"x\",m(y,t,\"x\",T,e)),S(\"y\",m(x,r,\"y\",T,e)),e.axref===e.xref&&S(\"ax\",m(y,t,\"ax\",T,e)),e.ayref===e.yref&&S(\"ay\",m(x,r,\"ay\",T,e)),G.attr(\"transform\",s(t,r)),I.attr({transform:\"rotate(\"+P+\",\"+i+\",\"+a+\")\"})},doneFn:function(){i.call(\"_guiRelayout\",t,E());var e=document.querySelector(\".js-notes-box-panel\");e&&e.redraw(e.selectedObj)}})}}};e.showarrow&&At(0,0),D&&d.init({element:R.node(),gd:t,prepFn:function(){kt=I.attr(\"transform\")},moveFn:function(t,r){var n=\"pointer\";if(e.showarrow)e.axref===e.xref?S(\"ax\",m(y,t,\"ax\",T,e)):S(\"ax\",e.ax+t),e.ayref===e.yref?S(\"ay\",m(x,r,\"ay\",T.w,e)):S(\"ay\",e.ay+r),At(t,r);else{if(a)return;var i,o;if(y)i=m(y,t,\"x\",T,e);else{var l=e._xsize/T.w,u=e.x+(e._xshift-e.xshift)/T.w-l/2;i=d.align(u+t/T.w,l,0,1,e.xanchor)}if(x)o=m(x,r,\"y\",T,e);else{var c=e._ysize/T.h,f=e.y-(e._yshift+e.yshift)/T.h-c/2;o=d.align(f-r/T.h,c,0,1,e.yanchor)}S(\"x\",i),S(\"y\",o),y&&x||(n=d.getCursor(y?.5:i,x?.5:o,e.xanchor,e.yanchor))}I.attr({transform:s(t,r)+kt}),p(R,n)},clickFn:function(r,n){e.captureevents&&t.emit(\"plotly_clickannotation\",Z(n))},doneFn:function(){p(R),i.call(\"_guiRelayout\",t,E());var e=document.querySelector(\".js-notes-box-panel\");e&&e.redraw(e.selectedObj)}})}}}t.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(\".annotation\").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&y(t,r);return a.previousPromises(t)},drawOne:y,drawRaw:x}},13011:function(t,e,r){\"use strict\";var n=r(39898),i=r(7901),a=r(82884),o=r(71828),s=o.strScale,l=o.strRotate,u=o.strTranslate;t.exports=function(t,e,r){var o,c,f,h,p=t.node(),d=a[r.arrowhead||0],v=a[r.startarrowhead||0],g=(r.arrowwidth||1)*(r.arrowsize||1),y=(r.arrowwidth||1)*(r.startarrowsize||1),m=e.indexOf(\"start\")>=0,x=e.indexOf(\"end\")>=0,b=d.backoff*g+r.standoff,_=v.backoff*y+r.startstandoff;if(\"line\"===p.nodeName){o={x:+t.attr(\"x1\"),y:+t.attr(\"y1\")},c={x:+t.attr(\"x2\"),y:+t.attr(\"y2\")};var w=o.x-c.x,T=o.y-c.y;if(h=(f=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void D();if(b){if(b*b>w*w+T*T)return void D();var k=b*Math.cos(f),A=b*Math.sin(f);c.x+=k,c.y+=A,t.attr({x2:c.x,y2:c.y})}if(_){if(_*_>w*w+T*T)return void D();var M=_*Math.cos(f),S=_*Math.sin(f);o.x-=M,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if(\"path\"===p.nodeName){var E=p.getTotalLength(),L=\"\";if(E<b+_)return void D();var C=p.getPointAtLength(0),P=p.getPointAtLength(.1);f=Math.atan2(C.y-P.y,C.x-P.x),o=p.getPointAtLength(Math.min(_,E)),L=\"0px,\"+_+\"px,\";var O=p.getPointAtLength(E),I=p.getPointAtLength(E-.1);h=Math.atan2(O.y-I.y,O.x-I.x),c=p.getPointAtLength(Math.max(0,E-b)),L+=E-(L?_+b:b)+\"px,\"+E+\"px\",t.style(\"stroke-dasharray\",L)}function D(){t.style(\"stroke-dasharray\",\"0px,100px\")}function z(e,a,o,c){e.path&&(e.noRotate&&(o=0),n.select(p.parentNode).append(\"path\").attr({class:t.attr(\"class\"),d:e.path,transform:u(a.x,a.y)+l(180*o/Math.PI)+s(c)}).style({fill:i.rgb(r.arrowcolor),\"stroke-width\":0}))}m&&z(v,o,f,y),x&&z(d,c,h,g)}},32745:function(t,e,r){\"use strict\";var n=r(92605),i=r(44317);t.exports={moduleType:\"component\",name:\"annotations\",layoutAttributes:r(50215),su