|
| 1 | +'use strict'; |
| 2 | + |
| 3 | +var Plotly = require('../src/plotly'); |
| 4 | +var rules = { |
| 5 | + "X,X div": "font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;", |
| 6 | + "X input,X button": "font-family:'Open Sans', verdana, arial, sans-serif;", |
| 7 | + "X input:focus,X button:focus": "outline:none;", |
| 8 | + "X a": "text-decoration:none;", |
| 9 | + "X a:hover": "text-decoration:none;", |
| 10 | + "X .crisp": "shape-rendering:crispEdges;", |
| 11 | + "X svg a": "fill:#447adb;", |
| 12 | + "X svg a:hover": "fill:#3c6dc5;", |
| 13 | + "X .main-svg": "position:absolute;top:0;left:0;pointer-events:none;", |
| 14 | + "X .main-svg .draglayer": "pointer-events:all;", |
| 15 | + "X .cursor-pointer": "cursor:pointer;", |
| 16 | + "X .cursor-crosshair": "cursor:crosshair;", |
| 17 | + "X .cursor-move": "cursor:move;", |
| 18 | + "X .cursor-col-resize": "cursor:col-resize;", |
| 19 | + "X .cursor-row-resize": "cursor:row-resize;", |
| 20 | + "X .cursor-ns-resize": "cursor:ns-resize;", |
| 21 | + "X .cursor-ew-resize": "cursor:ew-resize;", |
| 22 | + "X .cursor-sw-resize": "cursor:sw-resize;", |
| 23 | + "X .cursor-s-resize": "cursor:s-resize;", |
| 24 | + "X .cursor-se-resize": "cursor:se-resize;", |
| 25 | + "X .cursor-w-resize": "cursor:w-resize;", |
| 26 | + "X .cursor-e-resize": "cursor:e-resize;", |
| 27 | + "X .cursor-nw-resize": "cursor:nw-resize;", |
| 28 | + "X .cursor-n-resize": "cursor:n-resize;", |
| 29 | + "X .cursor-ne-resize": "cursor:ne-resize;", |
| 30 | + "X .modebar": "position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);", |
| 31 | + "X .modebar--hover": "opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;", |
| 32 | + "X:hover .modebar--hover": "opacity:1;", |
| 33 | + "X .modebar-group": "float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;", |
| 34 | + "X .modebar-group:first-child": "margin-left:0px;", |
| 35 | + "X .modebar-btn": "position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;", |
| 36 | + "X .modebar-btn svg": "position:relative;top:2px;", |
| 37 | + "X .modebar-btn path": "fill:rgba(0,31,95,0.3);", |
| 38 | + "X .modebar-btn.active path,X .modebar-btn:hover path": "fill:rgba(0,22,72,0.5);", |
| 39 | + "X .modebar-btn.modebar-btn--logo": "padding:3px 1px;", |
| 40 | + "X .modebar-btn.modebar-btn--logo path": "fill:#447adb !important;", |
| 41 | + "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%;", |
| 42 | + "X [data-title]:hover:before,X [data-title]:hover:after": "display:block;opacity:1;", |
| 43 | + "X [data-title]:before": "content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;", |
| 44 | + "X [data-title]:after": "content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;", |
| 45 | + Y: "font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;", |
| 46 | + "Y p": "margin:0;", |
| 47 | + "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,0.9);color:#fff;padding:10px;", |
| 48 | + "Y .notifier-close": "color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;", |
| 49 | + "Y .notifier-close:hover": "color:#444;text-decoration:none;cursor:pointer;" |
| 50 | +}; |
| 51 | + |
| 52 | +for(var selector in rules) { |
| 53 | + var fullSelector = selector.replace(/^,/,' ,') |
| 54 | + .replace(/X/g, '.js-plotly-plot .plotly') |
| 55 | + .replace(/Y/g, '.plotly-notifier'); |
| 56 | + Plotly.Lib.addStyleRule(fullSelector, rules[selector]); |
| 57 | +} |
0 commit comments