Skip to content

Commit 3be7ac9

Browse files
remove chart-generation code from JS doc index
1 parent a726c4f commit 3be7ac9

File tree

1 file changed

+0
-240
lines changed

1 file changed

+0
-240
lines changed

_posts/plotly_js/2015-04-05-plotly_js-index.html

Lines changed: 0 additions & 240 deletions
Original file line numberDiff line numberDiff line change
@@ -164,243 +164,3 @@ <h1>Plotly JavaScript Open Source Graphing Library</h1>
164164
{% assign languagelistimg = site.posts | where:"page_type","example_index" | where:"language","plotly_js" | where:"has_thumbnail",true | sort: "order" %}
165165
{% assign languagelist = site.posts | where:"page_type","example_index" | where:"language","plotly_js" %}
166166
{% include documentation_eg.html %}
167-
168-
169-
<script type="text/javascript">
170-
var windspeed = document.getElementById('wind-speed'),
171-
contour = document.getElementById('contour-plot'),
172-
myGraph = document.getElementById('my-graph'),
173-
plots = [
174-
{ element: windspeed, plotted: false, doPlot: plotWindspeed },
175-
// { element: contour, plotted: false, doPlot: plotTurbulenceSimulation },
176-
{ element: myGraph, plotted: false, doPlot: plotLifeExpectancy }
177-
];
178-
179-
function plotLifeExpectancy(element){
180-
var data = [{
181-
"name":"Asia",
182-
"text": ["Afghanistan","Bahrain","Bangladesh","Cambodia","China",
183-
"Hong Kong, China","India","Indonesia","Iran","Iraq","Israel","Japan",
184-
"Jordan","Korea, Dem. Rep.","Korea, Rep.","Kuwait","Lebanon",
185-
"Malaysia","Mongolia","Myanmar","Nepal","Oman","Pakistan",
186-
"Philippines","Saudi Arabia","Singapore","Sri Lanka","Syria","Taiwan",
187-
"Thailand","Vietnam","West Bank and Gaza","Yemen, Rep."],
188-
"marker": {
189-
"sizemode":"area",
190-
"sizeref":200000,
191-
"size": ["31889923","708573","150448339","14131858","1318683096",
192-
"6980412","1110396331","223547000","69453570","27499638","6426679",
193-
"127467972","6053193","23301725","49044790","2505559","3921278",
194-
"24821286","2874127","47761980","28901790","3204897","169270617",
195-
"91077287","27601038","4553009","20378239","19314747","23174294",
196-
"65068149","85262356","4018332","22211743"]
197-
},
198-
"mode":"markers",
199-
"y": ["974.5803384","29796.04834","1391.253792","1713.778686",
200-
"4959.114854","39724.97867","2452.210407","3540.651564","11605.71449",
201-
"4471.061906","25523.2771","31656.06806","4519.461171","1593.06548",
202-
"23348.13973","47306.98978","10461.05868","12451.6558","3095.772271",
203-
"944","1091.359778","22316.19287","2605.94758","3190.481016",
204-
"21654.83194","47143.17964","3970.095407","4184.548089","28718.27684",
205-
"7458.396327","2441.576404","3025.349798","2280.769906"],
206-
"x": ["43.828","75.635","64.062","59.723","72.961","82.208","64.698",
207-
"70.65","70.964","59.545","80.745","82.603","72.535","67.297",
208-
"78.623","77.588","71.993","74.241","66.803","62.069","63.785",
209-
"75.64","65.483","71.688","72.777","79.972","72.396","74.143","78.4",
210-
"70.616","74.249","73.422","62.698"],
211-
"uid": "99da6d"
212-
},{
213-
"name":"Europe",
214-
"text": ["Albania","Austria","Belgium","Bosnia and Herzegovina",
215-
"Bulgaria","Croatia","Czech Republic","Denmark","Finland","France",
216-
"Germany","Greece","Hungary","Iceland","Ireland","Italy","Montenegro",
217-
"Netherlands","Norway","Poland","Portugal","Romania","Serbia",
218-
"Slovak Republic","Slovenia","Spain","Sweden","Switzerland","Turkey",
219-
"United Kingdom"],
220-
"marker": {
221-
"sizemode":"area",
222-
"sizeref":200000,
223-
"size": ["3600523","8199783","10392226","4552198","7322858","4493312",
224-
"10228744","5468120","5238460","61083916","82400996","10706290",
225-
"9956108","301931","4109086","58147733","684736","16570613","4627926",
226-
"38518241","10642836","22276056","10150265","5447502","2009245",
227-
"40448191","9031088","7554661","71158647","60776238"]
228-
},
229-
"mode":"markers",
230-
"y": ["5937.029526","36126.4927","33692.60508","7446.298803",
231-
"10680.79282","14619.22272","22833.30851","35278.41874","33207.0844",
232-
"30470.0167","32170.37442","27538.41188","18008.94444","36180.78919",
233-
"40675.99635","28569.7197","9253.896111","36797.93332","49357.19017",
234-
"15389.92468","20509.64777","10808.47561","9786.534714","18678.31435",
235-
"25768.25759","28821.0637","33859.74835","37506.41907","8458.276384",
236-
"33203.26128"],
237-
"x": ["76.423","79.829","79.441","74.852","73.005","75.748","76.486",
238-
"78.332","79.313","80.657","79.406","79.483","73.338","81.757",
239-
"78.885","80.546","74.543","79.762","80.196","75.563","78.098",
240-
"72.476","74.002","74.663","77.926","80.941","80.884","81.701",
241-
"71.777","79.425"],
242-
"uid": "9d3ba4"
243-
},{
244-
"name": "Africa",
245-
"text": ["Algeria","Angola","Benin","Botswana","Burkina Faso","Burundi",
246-
"Cameroon","Central African Republic","Chad","Comoros",
247-
"Congo, Dem. Rep.","Congo, Rep.","Cote d'Ivoire","Djibouti","Egypt",
248-
"Equatorial Guinea","Eritrea","Ethiopia","Gabon","Gambia","Ghana",
249-
"Guinea","Guinea-Bissau","Kenya","Lesotho","Liberia","Libya",
250-
"Madagascar","Malawi","Mali","Mauritania","Mauritius","Morocco",
251-
"Mozambique","Namibia","Niger","Nigeria","Reunion","Rwanda",
252-
"Sao Tome and Principe","Senegal","Sierra Leone","Somalia",
253-
"South Africa","Sudan","Swaziland","Tanzania","Togo","Tunisia","Uganda",
254-
"Zambia","Zimbabwe"],
255-
"marker": {
256-
"sizemode":"area",
257-
"sizeref":200000,
258-
"size": ["33333216","12420476","8078314","1639131","14326203",
259-
"8390505","17696293","4369038","10238807","710960","64606759",
260-
"3800610","18013409","496374","80264543","551201","4906585",
261-
"76511887","1454867","1688359","22873338","9947814","1472041",
262-
"35610177","2012649","3193942","6036914","19167654","13327079",
263-
"12031795","3270065","1250882","33757175","19951656","2055080",
264-
"12894865","135031164","798094","8860588","199579","12267493",
265-
"6144562","9118773","43997828","42292929","1133066","38139640",
266-
"5701579","10276158","29170398","11746035","12311143"]
267-
},
268-
"mode": "markers",
269-
"y": ["6223.367465","4797.231267","1441.284873","12569.85177",
270-
"1217.032994","430.0706916","2042.09524","706.016537","1704.063724",
271-
"986.1478792","277.5518587","3632.557798","1544.750112",
272-
"2082.481567","5581.180998","12154.08975","641.3695236",
273-
"690.8055759","13206.48452","752.7497265","1327.60891",
274-
"942.6542111","579.231743","1463.249282","1569.331442",
275-
"414.5073415","12057.49928","1044.770126","759.3499101",
276-
"1042.581557","1803.151496","10956.99112","3820.17523",
277-
"823.6856205","4811.060429","619.6768924","2013.977305",
278-
"7670.122558","863.0884639","1598.435089","1712.472136",
279-
"862.5407561","926.1410683","9269.657808","2602.394995",
280-
"4513.480643","1107.482182","882.9699438","7092.923025",
281-
"1056.380121","1271.211593","469.7092981"],
282-
"x": ["72.301","42.731","56.728","50.728","52.295","49.58","50.43",
283-
"44.741","50.651","65.152","46.462","55.322","48.328","54.791",
284-
"71.338","51.579","58.04","52.947","56.735","59.448","60.022",
285-
"56.007","46.388","54.11","42.592","45.678","73.952","59.443",
286-
"48.303","54.467","64.164","72.801","71.164","42.082","52.906",
287-
"56.867","46.859","76.442","46.242","65.528","63.062","42.568",
288-
"48.159","49.339","58.556","39.613","52.517","58.42","73.923",
289-
"51.542","42.384","43.487"],
290-
"uid": "22be38"
291-
},{
292-
"name": "Oceania",
293-
"text": ["Australia","New Zealand"],
294-
"marker": {
295-
"sizemode":"area",
296-
"sizeref":200000,
297-
"size": ["20434176","4115771"]
298-
},
299-
"mode":"markers",
300-
"y": ["34435.36744","25185.00911"],
301-
"x": ["81.235","80.204"],
302-
"uid":"f9fb74"
303-
},{
304-
"name":"Americas",
305-
"text": ["Argentina","Bolivia","Brazil","Canada","Chile","Colombia",
306-
"Costa Rica","Cuba","Dominican Republic","Ecuador","El Salvador",
307-
"Guatemala","Haiti","Honduras","Jamaica","Mexico","Nicaragua",
308-
"Panama","Paraguay","Peru","Puerto Rico","Trinidad and Tobago",
309-
"United States","Uruguay","Venezuela"],
310-
"marker": {
311-
"sizemode":"area",
312-
"sizeref":200000,
313-
"size": ["40301927","9119152","190010647","33390141","16284741",
314-
"44227550","4133884","11416987","9319622","13755680","6939688",
315-
"12572928","8502814","7483763","2780132","108700891","5675356",
316-
"3242173","6667147","28674757","3942491","1056608","301139947",
317-
"3447496","26084662"]
318-
},
319-
"mode":"markers",
320-
"y": ["12779.37964","3822.137084","9065.800825","36319.23501",
321-
"13171.63885","7006.580419","9645.06142","8948.102923",
322-
"6025.374752","6873.262326","5728.353514","5186.050003",
323-
"1201.637154","3548.330846","7320.880262","11977.57496",
324-
"2749.320965","9809.185636","4172.838464","7408.905561",
325-
"19328.70901","18008.50924","42951.65309","10611.46299",
326-
"11415.80569"],
327-
"x": ["75.32","65.554","72.39","80.653","78.553","72.889","78.782",
328-
"78.273","72.235","74.994","71.878","70.259","60.916","70.198",
329-
"72.567","76.195","72.899","75.537","71.752","71.421","78.746",
330-
"69.819","78.242","76.384","73.747"],
331-
"uid":"c3a87b"
332-
}];
333-
334-
var layout = {
335-
xaxis: {title: 'Life Expectancy'},
336-
yaxis: {title: 'GDP per Capita', type: 'log'},
337-
margin: {t: 20},
338-
hovermode: 'closest'
339-
};
340-
341-
Plotly.plot(element, data, layout, {showLink: false});
342-
}
343-
344-
345-
function plotWindspeed (element) {
346-
var data = [{
347-
"y":["22.3","23","23.3","22","20.5","25.2","24.8","24","22.9","17.9","20.3","21.5","21.3","21.3","21.3","22.4","25.4","25.9","25.5","25.7","23.9","24.7","26.3","26.9","29","24.4","21.4","20","18.3","17.1","17.6","16.7","11.4","16.6","16.1","16","17","17.2","17.1","16.8","16.6","17.5","17.1","18.6","18.4","15","16","16.5","18.7","16.7","14.7","13.6","16","15.9","16.2","17.7","16.2","15.9","15.4","18.3","18.1","19.2","17.5","16","14.9","15.4","14.7","15.5","17.4","14.1","14","13","14.7","14.2","15","14.3","14.7","15.9","17.7","16.1","15.3","15.2","14.7","15.9","14.8","15.2","14.5","15.1","15.2","15.3","15.2","14.9","15.4","15.3","14.5","15.7","15","14","11.3","11.8","12.1","12.3","12.3","12.2","11.8","9.3","8.7","9.5","8.9","7.2","8","7.9","5.5","4.9","8.9","8.6","12.1","15","13.8","14.9","15.9","19.6","24.9","19.2","21.7","13.5","17.2","28.5","29.9","30.9","27.8","26.1","23.6","17.4","18.6","12.1","14.9","13.8","13.3","10.7","12.2","17.8","17.8","18.3","11.3","16.8","8.7","14.4","12.3","15.4","10","15.1","14.8","12.8","9.6","12.5","15.5","18.9","19.8","20.4","19.3","20.6","22.3","22.6","21","23.3","21.9","22.8","24.6","24","25","26.9","28.4","27.1","24.4","24.4","28.8","28.9","28.5","27.5","24.9","27","25.7","26.6","25.2","28.6","32.5","32.7","30.2","30","24.9","25.7","24.5","24.5","26.7","25.9","27.5","28.2","26.2","26.8","26.7","26.7","25.5","25.4","24.9","25.2","27.8","27.1","26.8","27.6","26.6","26.4","27.1","24.7","23.1","22.1","22","21.2","22.9","21.6","22.2"],
348-
"x":["2001-06-11 11:00","2001-06-11 11:10","2001-06-11 11:20","2001-06-11 11:30","2001-06-11 11:40","2001-06-11 11:50","2001-06-11 12:00","2001-06-11 12:10","2001-06-11 12:20","2001-06-11 12:30","2001-06-11 12:40","2001-06-11 12:50","2001-06-11 13:00","2001-06-11 13:10","2001-06-11 13:20","2001-06-11 13:30","2001-06-11 13:40","2001-06-11 13:50","2001-06-11 14:00","2001-06-11 14:10","2001-06-11 14:20","2001-06-11 14:30","2001-06-11 14:40","2001-06-11 14:50","2001-06-11 15:00","2001-06-11 15:10","2001-06-11 15:20","2001-06-11 15:30","2001-06-11 15:40","2001-06-11 15:50","2001-06-11 16:00","2001-06-11 16:10","2001-06-11 16:20","2001-06-11 16:30","2001-06-11 16:40","2001-06-11 16:50","2001-06-11 17:00","2001-06-11 17:10","2001-06-11 17:20","2001-06-11 17:30","2001-06-11 17:40","2001-06-11 17:50","2001-06-11 18:00","2001-06-11 18:10","2001-06-11 18:20","2001-06-11 18:30","2001-06-11 18:40","2001-06-11 18:50","2001-06-11 19:00","2001-06-11 19:10","2001-06-11 19:20","2001-06-11 19:30","2001-06-11 19:40","2001-06-11 19:50","2001-06-11 20:00","2001-06-11 20:10","2001-06-11 20:20","2001-06-11 20:30","2001-06-11 20:40","2001-06-11 20:50","2001-06-11 21:00","2001-06-11 21:10","2001-06-11 21:20","2001-06-11 21:30","2001-06-11 21:40","2001-06-11 21:50","2001-06-11 22:00","2001-06-11 22:10","2001-06-11 22:20","2001-06-11 22:30","2001-06-11 22:40","2001-06-11 22:50","2001-06-11 23:00","2001-06-11 23:10","2001-06-11 23:20","2001-06-11 23:30","2001-06-11 23:40","2001-06-11 23:50","2001-06-12 00:00","2001-06-12 00:10","2001-06-12 00:20","2001-06-12 00:30","2001-06-12 00:40","2001-06-12 00:50","2001-06-12 01:00","2001-06-12 01:10","2001-06-12 01:20","2001-06-12 01:30","2001-06-12 01:40","2001-06-12 01:50","2001-06-12 02:00","2001-06-12 02:10","2001-06-12 02:20","2001-06-12 02:30","2001-06-12 02:40","2001-06-12 02:50","2001-06-12 03:00","2001-06-12 03:10","2001-06-12 03:20","2001-06-12 03:30","2001-06-12 03:40","2001-06-12 03:50","2001-06-12 04:00","2001-06-12 04:10","2001-06-12 04:20","2001-06-12 04:30","2001-06-12 04:40","2001-06-12 04:50","2001-06-12 05:00","2001-06-12 05:10","2001-06-12 05:20","2001-06-12 05:30","2001-06-12 05:40","2001-06-12 05:50","2001-06-12 06:00","2001-06-12 06:10","2001-06-12 06:20","2001-06-12 06:30","2001-06-12 06:40","2001-06-12 06:50","2001-06-12 07:00","2001-06-12 07:10","2001-06-12 07:20","2001-06-12 07:30","2001-06-12 07:40","2001-06-12 07:50","2001-06-12 08:00","2001-06-12 08:10","2001-06-12 08:20","2001-06-12 08:30","2001-06-12 08:40","2001-06-12 08:50","2001-06-12 09:00","2001-06-12 09:10","2001-06-12 09:20","2001-06-12 09:30","2001-06-12 09:40","2001-06-12 09:50","2001-06-12 10:00","2001-06-12 10:10","2001-06-12 10:20","2001-06-12 10:30","2001-06-12 10:40","2001-06-12 10:50","2001-06-12 11:00","2001-06-12 11:10","2001-06-12 11:20","2001-06-12 11:30","2001-06-12 11:40","2001-06-12 11:50","2001-06-12 12:00","2001-06-12 12:10","2001-06-12 12:20","2001-06-12 12:30","2001-06-12 12:40","2001-06-12 12:50","2001-06-12 13:00","2001-06-12 13:10","2001-06-12 13:20","2001-06-12 13:30","2001-06-12 13:40","2001-06-12 13:50","2001-06-12 14:00","2001-06-12 14:10","2001-06-12 14:20","2001-06-12 14:30","2001-06-12 14:40","2001-06-12 14:50","2001-06-12 15:00","2001-06-12 15:10","2001-06-12 15:20","2001-06-12 15:30","2001-06-12 15:40","2001-06-12 15:50","2001-06-12 16:00","2001-06-12 16:10","2001-06-12 16:20","2001-06-12 16:30","2001-06-12 16:40","2001-06-12 16:50","2001-06-12 17:00","2001-06-12 17:10","2001-06-12 17:20","2001-06-12 17:30","2001-06-12 17:40","2001-06-12 17:50","2001-06-12 18:00","2001-06-12 18:10","2001-06-12 18:20","2001-06-12 18:30","2001-06-12 18:40","2001-06-12 18:50","2001-06-12 19:00","2001-06-12 19:10","2001-06-12 19:20","2001-06-12 19:30","2001-06-12 19:40","2001-06-12 19:50","2001-06-12 20:00","2001-06-12 20:10","2001-06-12 20:20","2001-06-12 20:30","2001-06-12 20:40","2001-06-12 20:50","2001-06-12 21:00","2001-06-12 21:10","2001-06-12 21:20","2001-06-12 21:30","2001-06-12 21:40","2001-06-12 21:50","2001-06-12 22:00","2001-06-12 22:10","2001-06-12 22:20","2001-06-12 22:30","2001-06-12 22:40","2001-06-12 22:50","2001-06-12 23:00","2001-06-12 23:10","2001-06-12 23:20","2001-06-12 23:30","2001-06-12 23:40"],
349-
"line": {"width":1},
350-
"error_y":{
351-
"width":0,
352-
"array": ["2.73","1.98","1.87","2.03","3.1","2.3","2.46","1.87","1.71","1.76","1.87","1.66","2.09","1.6","1.44","3.69","2.78","2.14","2.67","2.57","2.35","2.67","2.46","2.73","2.19","3.32","1.98","2.46","1.76","1.82","2.3","1.98","2.3","2.62","2.3","2.09","2.51","2.19","2.62","2.94","3.05","2.62","2.09","2.03","2.03","2.73","2.19","2.14","2.41","2.62","2.3","2.09","2.89","2.73","2.14","2.46","2.14","1.87","2.19","2.35","2.41","2.62","2.3","1.92","2.14","1.98","1.55","1.87","2.41","2.41","1.82","2.25","2.3","1.98","2.25","2.19","1.98","2.09","2.09","2.03","2.03","1.76","1.98","2.14","2.09","2.03","1.92","2.09","1.92","2.19","2.03","2.09","2.35","1.98","1.55","2.25","1.82","1.92","1.92","1.66","1.6","1.82","1.6","1.76","1.66","1.71","1.28","1.02","1.66","0.91","1.34","1.02","1.28","1.07","1.23","1.23","1.39","1.87","2.03","1.98","2.03","3.26","3.26","3.69","4.06","2.94","6.1","2.62","3.26","3.32","3.96","3.32","3.74","4.81","2.73","1.92","2.78","2.89","2.41","2.83","1.07","4.17","1.55","2.14","1.82","2.35","2.62","13.63","1.71","2.99","1.5","2.83","2.78","2.51","1.44","1.76","2.03","1.98","1.76","2.35","2.46","3.53","2.67","2.99","3.15","3.9","2.99","3.15","3.26","3.05","3.64","3.69","3.69","3.74","3.21","4.49","3.85","3.42","2.62","3.53","2.94","3.64","3.37","3.96","3.53","3.96","4.97","4.28","2.57","3.9","2.99","2.94","2.83","3.15","3.74","3.15","3.05","2.89","2.46","2.62","2.78","2.51","2.35","2.46","2.73","2.51","3.26","2.41","2.46","2.62","2.94","2.73","2.46","2.94","2.09","2.09","2.03","2.14","2.35","1.98","2.19"],
353-
"thickness":0.5
354-
},
355-
"uid":"40abaa"
356-
}];
357-
var layout = {
358-
yaxis: {title: "Wind Speed"},
359-
xaxis: {showgrid: false, tickformat: "%B %e"},
360-
margin: {l: 60, b: 37, t: 0, r: 20}
361-
};
362-
363-
Plotly.plot(element, data, layout, {showLink: false});
364-
}
365-
366-
function plotAll(){
367-
plots.forEach(function(plot){
368-
var elementBox = plot.element.getBoundingClientRect(),
369-
topVisible = elementBox.top < window.innerHeight * 1.5,
370-
bottomVisible = elementBox.bottom > window.innerHeight * 0.5,
371-
visible = topVisible && bottomVisible;
372-
373-
if(!plot.plotted && visible){
374-
plot.doPlot(plot.element);
375-
plot.plotted = true;
376-
}
377-
});
378-
}
379-
380-
function debounce(func, wait, immediate) {
381-
var timeout;
382-
return function() {
383-
var context = this,
384-
args = arguments;
385-
386-
var later = function() {
387-
timeout = null;
388-
if (!immediate) func.apply(context, args);
389-
};
390-
var callNow = immediate && !timeout;
391-
clearTimeout(timeout);
392-
timeout = setTimeout(later, wait);
393-
if (callNow) func.apply(context, args);
394-
};
395-
};
396-
397-
window.addEventListener('scroll', debounce(plotAll, 100));
398-
399-
window.addEventListener("resize", function(){
400-
plots.forEach(function (plot) {
401-
Plotly.Plots.resize(plot.element, { showLink: false });
402-
});
403-
});
404-
405-
plotAll();
406-
</script>

0 commit comments

Comments
 (0)