summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Aptekarev <aptekarev@gmail.com>2024-05-21 14:52:14 +0200
committerGitHub <noreply@github.com>2024-05-21 14:52:14 +0200
commit6a10598f5be0d8823e360e9ceeec4569099c107c (patch)
tree2d72949f4fa4c478d569c148b5a14809e153271a
parentc4de0a8f3656798d4884e4b92ae97639c1ce5bee (diff)
Remove PDF export capabilities (#6442)
* Bump black in devtools and pre-commit * Remove pdf export functionality from cli and charting extensions * print message only if the file was actually created * Update css to use fonts from google * Bump bundled plotly js version * Bump dependencies * Update static html of the charting extension to use the new plotly * Update lock file hashes --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: hjoaquim <henriquecjoaquim@gmail.com>
-rw-r--r--cli/openbb_cli/controllers/base_controller.py10
-rw-r--r--cli/openbb_cli/controllers/choices.py10
-rw-r--r--cli/openbb_cli/controllers/utils.py7
-rw-r--r--frontend-components/plotly/package-lock.json2
-rw-r--r--frontend-components/plotly/package.json2
-rw-r--r--frontend-components/plotly/src/components/Chart.tsx2
-rw-r--r--frontend-components/plotly/src/index.css11
-rw-r--r--frontend-components/plotly/src/utils/utils.ts4
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/assets/plotly-2.24.2.min.js8
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/assets/plotly-2.32.0.min.js8
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/backend.py13
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/openbb_figure.py6
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly.html2638
-rw-r--r--openbb_platform/obbject_extensions/charting/poetry.lock1108
-rw-r--r--openbb_platform/obbject_extensions/charting/pyproject.toml2
-rw-r--r--website/content/cli/data-sources.md2
-rw-r--r--website/content/cli/quickstart.md2
17 files changed, 948 insertions, 2887 deletions
diff --git a/cli/openbb_cli/controllers/base_controller.py b/cli/openbb_cli/controllers/base_controller.py
index e3c4a8ecfa0..b1952da5fcf 100644
--- a/cli/openbb_cli/controllers/base_controller.py
+++ b/cli/openbb_cli/controllers/base_controller.py
@@ -745,11 +745,11 @@ class BaseController(metaclass=ABCMeta):
choices_export = ["csv", "json", "xlsx"]
help_export = "Export raw data into csv, json, xlsx"
elif export_allowed == "figures_only":
- choices_export = ["png", "jpg", "pdf", "svg"]
- help_export = "Export figure into png, jpg, pdf, svg "
+ choices_export = ["png", "jpg", "svg"]
+ help_export = "Export figure into png, jpg, svg "
else:
- choices_export = ["csv", "json", "xlsx", "png", "jpg", "pdf", "svg"]
- help_export = "Export raw data into csv, json, xlsx and figure into png, jpg, pdf, svg "
+ choices_export = ["csv", "json", "xlsx", "png", "jpg", "svg"]
+ help_export = "Export raw data into csv, json, xlsx and figure into png, jpg, svg "
parser.add_argument(
"--export",
@@ -812,7 +812,7 @@ class BaseController(metaclass=ABCMeta):
"raw_data_and_figures",
]:
ns_parser.is_image = any(
- ext in ns_parser.export for ext in ["png", "svg", "jpg", "pdf"]
+ ext in ns_parser.export for ext in ["png", "svg", "jpg"]
)
except SystemExit:
diff --git a/cli/openbb_cli/controllers/choices.py b/cli/openbb_cli/controllers/choices.py
index aee144cf477..242cb098d46 100644
--- a/cli/openbb_cli/controllers/choices.py
+++ b/cli/openbb_cli/controllers/choices.py
@@ -58,11 +58,13 @@ def __mock_parse_known_args_and_warn(
choices_export = ["csv", "json", "xlsx"]
help_export = "Export raw data into csv, json, xlsx"
elif export_allowed == "figures_only":
- choices_export = ["png", "jpg", "pdf", "svg"]
- help_export = "Export figure into png, jpg, pdf, svg "
+ choices_export = ["png", "jpg", "svg"]
+ help_export = "Export figure into png, jpg, svg "
else:
- choices_export = ["csv", "json", "xlsx", "png", "jpg", "pdf", "svg"]
- help_export = "Export raw data into csv, json, xlsx and figure into png, jpg, pdf, svg "
+ choices_export = ["csv", "json", "xlsx", "png", "jpg", "svg"]
+ help_export = (
+ "Export raw data into csv, json, xlsx and figure into png, jpg, svg "
+ )
parser.add_argument(
"--export",
diff --git a/cli/openbb_cli/controllers/utils.py b/cli/openbb_cli/controllers/utils.py
index 333ad0b0cc6..d49279fd940 100644
--- a/cli/openbb_cli/controllers/utils.py
+++ b/cli/openbb_cli/controllers/utils.py
@@ -901,7 +901,7 @@ def export_data(
else:
save_to_excel(df, saved_path, sheet_name)
- elif saved_path.suffix in [".jpg", ".pdf", ".png", ".svg"]:
+ elif saved_path.suffix in [".jpg", ".png", ".svg"]:
if figure is None:
Session().console.print("No plot to export.")
continue
@@ -910,7 +910,10 @@ def export_data(
Session().console.print("Wrong export file specified.")
continue
- Session().console.print(f"Saved file: {saved_path}")
+ if saved_path.exists():
+ Session().console.print(f"Saved file: {saved_path}")
+ else:
+ Session().console.print(f"Failed to save file: {saved_path}")
if figure is not None:
figure._exported = True # pylint: disable=protected-access
diff --git a/frontend-components/plotly/package-lock.json b/frontend-components/plotly/package-lock.json
index 5801a3c9609..03a30b0d86f 100644
--- a/frontend-components/plotly/package-lock.json
+++ b/frontend-components/plotly/package-lock.json
@@ -24,7 +24,7 @@
"@types/plotly.js-dist-min": "^2.3.4",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
- "@types/react-plotly.js": "^2.6.0",
+ "@types/react-plotly.js": "^2.6.3",
"@types/wicg-file-system-access": "^2020.9.6",
"@vitejs/plugin-react": "^3.1.0",
"autoprefixer": "^10.4.13",
diff --git a/frontend-components/plotly/package.json b/frontend-components/plotly/package.json
index 88da60690fd..fd9a5a5881b 100644
--- a/frontend-components/plotly/package.json
+++ b/frontend-components/plotly/package.json
@@ -26,7 +26,7 @@
"@types/plotly.js-dist-min": "^2.3.4",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
- "@types/react-plotly.js": "^2.6.0",
+ "@types/react-plotly.js": "^2.6.3",
"@types/wicg-file-system-access": "^2020.9.6",
"@vitejs/plugin-react": "^3.1.0",
"autoprefixer": "^10.4.13",
diff --git a/frontend-components/plotly/src/components/Chart.tsx b/frontend-components/plotly/src/components/Chart.tsx
index b595261cd29..69f34834db9 100644
--- a/frontend-components/plotly/src/components/Chart.tsx
+++ b/frontend-components/plotly/src/components/Chart.tsx
@@ -605,7 +605,7 @@ function Chart({
const filename = window.export_image.split("/").pop();
const extension = filename.split(".").pop().replace("jpg", "jpeg");
- if (["jpeg", "png", "svg", "pdf"].includes(extension))
+ if (["jpeg", "png", "svg"].includes(extension))
return non_blocking(async function () {
await hideModebar();
await saveImage("MainChart", filename.split(".")[0], extension);
diff --git a/frontend-components/plotly/src/index.css b/frontend-components/plotly/src/index.css
index 185a1713edf..9ff4f37102d 100644
--- a/frontend-components/plotly/src/index.css
+++ b/frontend-components/plotly/src/index.css
@@ -1,15 +1,14 @@
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
+
@font-face {
font-family: "Fira Code";
- src: url("../../fonts/FiraCode-VF.ttf") format("truetype");
- /* fix Fire Code font width issue that makes Text get cut off in Plotly.js */
+ src: url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;700&display=swap") format("truetype");
font-weight: 400 700;
font-stretch: 50%;
}
-@tailwind base;
-@tailwind components;
-@tailwind utilities;
-
@layer components {
._input {
@apply w-full text-xs px-2 py-1 bg-grey-50 dark:bg-grey-900 h-[36px] border-[1.5px] border-grey-300 dark:border-grey-700 rounded outline-none dark:outline-1 focus:border-grey-500 active:border-grey-500 dark:text-white dark:focus:text-white dark:focus:border-white dark:active:border-white dark:hover:border-white disabled:border-grey-600 font-normal;
diff --git a/frontend-components/plotly/src/utils/utils.ts b/frontend-components/plotly/src/utils/utils.ts
index 4b35559bf9d..c895bc2022b 100644
--- a/frontend-components/plotly/src/utils/utils.ts
+++ b/frontend-components/plotly/src/utils/utils.ts
@@ -303,7 +303,7 @@ export async function saveImage(
) {
const chart = document.getElementById(id) as HTMLElement;
- if (["svg", "pdf"].includes(extension)) {
+ if (["svg"].includes(extension)) {
const chart = document.getElementById("plotlyChart") as HTMLElement;
const margin = chart.layout.margin;
const old_index = chart.layout.annotations.length;
@@ -351,7 +351,7 @@ export async function downloadImage(
}
await loadingOverlay(`Saving ${extension.toUpperCase()}`).then(
setTimeout(async function () {
- if (["svg", "pdf"].includes(extension)) {
+ if (["svg"].includes(extension)) {
await saveImage(id, filename, extension);
hidemodebar(false);
loading(false);
diff --git a/openbb_platform/obbject_extensions/charting/openbb_charting/core/assets/plotly-2.24.2.min.js b/openbb_platform/obbject_extensions/charting/openbb_charting/core/assets/plotly-2.24.2.min.js
deleted file mode 100644
index 7c308ae8b45..00000000000
--- a/openbb_platform/obbject_extensions/charting/openbb_charting/core/assets/plotly-2.24.2.min.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/**
-* plotly.js v2.24.2
-* Copyright 2012-2023, Plotly, Inc.
-* All rights reserved.
-* Licensed under the MIT license
-*/
-/*! For license information please see plotly.min.js.LICENSE.txt */
-!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.in