Skip to content

Commit 9e1de74

Browse files
committed
add icon
1 parent e608871 commit 9e1de74

3 files changed

Lines changed: 20 additions & 5 deletions

File tree

src/components/modebar/buttons.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ var Registry = require('../../registry');
44
var Plots = require('../../plots/plots');
55
var axisIds = require('../../plots/cartesian/axis_ids');
66
var Icons = require('../../fonts/ploticon');
7+
var uploadToCloud = require('./cloud').uploadToCloud;
78
var eraseActiveShape = require('../shapes/draw').eraseActiveShape;
89
var Lib = require('../../lib');
910
var _ = Lib._;
@@ -88,11 +89,8 @@ modeBarButtons.editInChartStudio = {
8889
modeBarButtons.uploadToCloud = {
8990
name: 'uploadToCloud',
9091
title: function(gd) { return _(gd, 'Upload to Cloud'); },
91-
icon: Icons.disk,
92-
click: function(gd) {
93-
var fig = Plots.graphJson(gd, false, 'keepdata', 'object', true, true);
94-
alert(JSON.stringify(fig, null, 2));
95-
}
92+
icon: Icons.cloudupload,
93+
click: uploadToCloud,
9694
};
9795

9896
modeBarButtons.zoom2d = {

src/components/modebar/cloud.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var Plots = require('../../plots/plots');
2+
3+
4+
function uploadToCloud(gd) {
5+
var fig = Plots.graphJson(gd, false, 'keepdata', 'object', true, true);
6+
alert(JSON.stringify(fig, null, 2));
7+
}
8+
9+
module.exports = {
10+
uploadToCloud: uploadToCloud
11+
};

src/fonts/ploticon.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ module.exports = {
103103
path: 'm214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z',
104104
transform: 'matrix(1 0 0 -1 0 850)'
105105
},
106+
cloudupload: {
107+
width: 640,
108+
height: 640,
109+
path: 'M176 544C96.5 544 32 479.5 32 400C32 336.6 73 282.8 129.9 263.5C128.6 255.8 128 248 128 240C128 160.5 192.5 96 272 96C327.4 96 375.5 127.3 399.6 173.1C413.8 164.8 430.4 160 448 160C501 160 544 203 544 256C544 271.7 540.2 286.6 533.5 299.7C577.5 320 608 364.4 608 416C608 486.7 550.7 544 480 544L176 544zM337 255C327.6 245.6 312.4 245.6 303.1 255L231.1 327C221.7 336.4 221.7 351.6 231.1 360.9C240.5 370.2 255.7 370.3 265 360.9L296 329.9L296 432C296 445.3 306.7 456 320 456C333.3 456 344 445.3 344 432L344 329.9L375 360.9C384.4 370.3 399.6 370.3 408.9 360.9C418.2 351.5 418.3 336.3 408.9 327L336.9 255z',
110+
transform: 'matrix(1 0 0 1 -15 -15)'
111+
},
106112
drawopenpath: {
107113
width: 70,
108114
height: 70,

0 commit comments

Comments
 (0)