Commit 36f1171165d4b95da73a20e4584c584266fcc2b7
1 parent
a1dedcfa
d3 scatterplot-datalet stub
Showing
2 changed files
with
80 additions
and
0 deletions
datalets/scatterplot-datalet/demo/index.html
0 → 100644
1 | +<!DOCTYPE html> | |
2 | +<html lang="en"> | |
3 | +<head> | |
4 | + <meta charset="UTF-8"> | |
5 | + <title></title> | |
6 | + | |
7 | + <script> | |
8 | + </script> | |
9 | + | |
10 | +</head> | |
11 | +<body> | |
12 | + | |
13 | +<script src="https://code.jquery.com/jquery-2.1.4.min.js" type="text/javascript"></script> | |
14 | +<link rel="import" href="../scatterplot-datalet.html" /> | |
15 | + | |
16 | + | |
17 | +<scatterplot-datalet data-url="http://ckan.ancitel.it/api/action/datastore_search?resource_id=29d9700a-fb2c-45fe-9cea-da856d5afd6c&limit=500" | |
18 | + fields='["result,records,area_geo","result,records,pop_residente","result,records,superficie_kmq"]'></scatterplot-datalet> | |
19 | + | |
20 | +</body> | |
21 | +</html> | |
0 | 22 | \ No newline at end of file | ... | ... |
datalets/scatterplot-datalet/scatterplot-datalet.html
0 → 100644
1 | + | |
2 | +<link rel="import" href="../base-ajax-json-alasql-datalet/base-ajax-json-alasql-datalet.html"> | |
3 | + | |
4 | + | |
5 | +<dom-module id="scatterplot-datalet"> | |
6 | + <template> | |
7 | + <div id="scatterplot-placeholder"></div> | |
8 | + <base-ajax-json-alasql-datalet data-url="{{dataUrl}}" fields="{{fields}}" data="{{data}}" title="{{title}}" description="{{description}}" export_menu="{{export_menu}}"></base-ajax-json-alasql-datalet> | |
9 | + </template> | |
10 | + | |
11 | + <script src="../shared_js/d3.js"></script> | |
12 | + <script> | |
13 | + | |
14 | + var ScatterplotBehavior = { | |
15 | + | |
16 | + }; | |
17 | + | |
18 | + ScatterplotDatalet = Polymer({ | |
19 | + is: 'scatterplot-datalet', | |
20 | + properties: { | |
21 | + xAxisLabel: { | |
22 | + type: String, | |
23 | + value: "" | |
24 | + }, | |
25 | + yAxisLabel: { | |
26 | + type: String, | |
27 | + value: "" | |
28 | + }, | |
29 | + behavior : { | |
30 | + type : Object, | |
31 | + value : {} | |
32 | + }, | |
33 | + /** | |
34 | + * Control the export menu | |
35 | + * xxxx BITMASK. FROM RIGHT : HTML, PNG, RTF, MY SPACE (eg. 1111 show all, 0000 hide all) | |
36 | + * | |
37 | + * @attribute export_menu | |
38 | + * @type Number | |
39 | + * @default 15 | |
40 | + */ | |
41 | + export_menu : { | |
42 | + type : Number, | |
43 | + value : 15 // xxxx BITMASK. FROM RIGHT : HTML, PNG, RTF, MY SPACE (eg. 1111 show all, 0000 hide all) | |
44 | + } | |
45 | + }, | |
46 | + | |
47 | + /** | |
48 | + * 'ready' callback extend the scatterchartComponentBehavior with HighchartsComponentBehavior and scatterchartBehavior | |
49 | + * and run the Datalet workcycle. | |
50 | + * | |
51 | + * @method ready | |
52 | + */ | |
53 | + ready: function(){ | |
54 | + this.behavior = $.extend(true, {}, BaseDataletBehavior, WorkcycleBehavior, AjaxJsonAlasqlBehavior, ScatterplotBehavior); | |
55 | + this.async(function(){this.behavior.init(this)},0); | |
56 | + } | |
57 | + }); | |
58 | + </script> | |
59 | +</dom-module> | |
0 | 60 | \ No newline at end of file | ... | ... |