Commit e61ed14e1565c93727189409f1e02dbca07752a6

Authored by isisadmin
2 parents 1b49624d c6d8e1a1

Merge branch 'master' of http://service.routetopa.eu:7480/WebCompDev/COMPONENTS

Showing 152 changed files with 13411 additions and 11 deletions

Too many changes.

To preserve performance only 100 of 152 files are displayed.

controllets/data-sevc-controllet/data-sevc-controllet.html
... ... @@ -56,23 +56,23 @@
56 56 <link rel="import" href="../text-element-controllet/text-element-controllet.html">
57 57  
58 58 <!--
59   - `data-sevc-controllet` is a controllet to generate visualization from a dataset accessible through api. A json response is required.
60   - It's composed by three pass. First, user have to select a datasource to access to a dataset. He can copy and paste/drag and drop an url(an api url with json response) or select
61   - from select contextual menu an available one. Second, the user selects the fields he want to visualize from a treeview by checking on it. A table preview of selected fields will show
62   - the currently selected values. Third, the users selects a visualization(datalet) from a slider and drags the previous selected fields in to the input data model fields area. A preview
63   - is available every time a fields is dragged in the input data model fields area.
  59 +The `data-sevc-controllet` is a controllet to generate visualization from a dataset accessible through api. A json response is required.
  60 +It's composed by three steps. First, user have to select a datasource to access to a dataset. He can copy and paste/drag and drop an url(an api url with json response) or select
  61 +from select contextual menu an available one. Second, the user selects the fields he want to visualize from a treeview by checking on it. A table preview of selected fields will show
  62 +the currently selected values. Third, the users selects a visualization(datalet) from a slider and drags the previous selected fields in to the input data model fields area. A preview
  63 +is available every time a fields is dragged in the input data model fields area.
64 64  
65 65 Example:
66 66  
67 67 <data-sevc-controllet deep-url="http://192.168.214.128/DatalEts-Ecosystem-Provider/DEEP/"
68 68 datalets-list-url="http://192.168.214.128/DatalEts-Ecosystem-Provider/DEEP/datalets-list"
69   - datasets='{[{name : 'dataset1', url : dataset1Urls}, ... , {name : 'datasetN', url : datasetNUrls}]' >
  69 + datasets='{[{name : 'dataset1', url : dataset1Urls}, ... , {name : 'datasetN', url : datasetNUrls}]'>
70 70 </data-sevc-controllet>
71 71  
72 72  
73 73 @element data-sevc-controllet
74 74 @status beta
75   -@homepage index.html
  75 +@homepage
76 76 @group controllets
77 77 -->
78 78  
... ...
controllets/full-view-controllet/full-view-controllet.html 0 → 100644
  1 +<link rel="import" href="../../bower_components/polymer/polymer.html">
  2 +<link rel="import" href="../../bower_components/paper-styles/paper-styles.html">
  3 +<link rel="import" href="../../bower_components/neon-animation/neon-animatable-behavior.html">
  4 +
  5 +<dom-module id="full-view-controllet">
  6 +
  7 + <style>
  8 +
  9 + :host {
  10 + @apply(--layout-vertical);
  11 + }
  12 +
  13 + .main {
  14 + background: white;
  15 + @apply(--layout-flex);
  16 + @apply(--layout-scroll);
  17 + @apply(--shadow-elevation-8dp);
  18 + }
  19 +
  20 + .image-container {
  21 + position: relative;
  22 + width: 100%;
  23 + padding-bottom: 100%;
  24 + }
  25 +
  26 + .image {
  27 + position: absolute;
  28 + width: 100%;
  29 + height: 100%;
  30 + background: repeating-linear-gradient(
  31 + 45deg,
  32 + #f5f5f5,
  33 + #f5f5f5 8px,
  34 + #e0e0e0 8px,
  35 + #e0e0e0 16px
  36 + );
  37 + }
  38 +
  39 + </style>
  40 +
  41 + <template>
  42 +
  43 + <paper-toolbar class="medium-tall" style="background: #2196F3;">
  44 + <paper-icon-button id="button" icon="clear" on-click="_onClearButtonClick"></paper-icon-button>
  45 + </paper-toolbar>
  46 +
  47 + <div id="main" class="main">
  48 + </div>
  49 +
  50 + </template>
  51 +
  52 +</dom-module>
  53 +
  54 +<script>
  55 +
  56 + Polymer({
  57 +
  58 + is: 'full-view-controllet',
  59 +
  60 + behaviors: [
  61 + Polymer.NeonAnimatableBehavior
  62 + ],
  63 +
  64 + properties: {
  65 +
  66 + sharedElements: {
  67 + type: Object,
  68 + value: function() {
  69 + return {
  70 + 'hero': this.$.main
  71 + };
  72 + }
  73 + },
  74 +
  75 + animationConfig: {
  76 + type: Object,
  77 + value: function() {
  78 + return {
  79 + 'entry': [{
  80 + name: 'fade-in-animation',
  81 + node: this.$.button
  82 + }, {
  83 + name: 'hero-animation',
  84 + id: 'hero',
  85 + toPage: this
  86 + }],
  87 +
  88 + 'exit': [{
  89 + name: 'fade-out-animation',
  90 + node: this.$.button
  91 + }, {
  92 + name: 'scale-down-animation',
  93 + node: this.$.main,
  94 + transformOrigin: '50% 50%',
  95 + axis: 'y'
  96 + }]
  97 +
  98 + }
  99 + }
  100 + }
  101 + },
  102 +
  103 + _onClearButtonClick: function() {
  104 + this.fire('close');
  105 + }
  106 +
  107 + });
  108 +
  109 +</script>
... ...
controllets/list-controllet/list-controllet.html 0 → 100644
  1 +<link rel="import" href="../../bower_components/polymer/polymer.html">
  2 +<link rel="import" href="../../bower_components/paper-styles/paper-styles.html">
  3 +<link rel="import" href="../../bower_components/paper-toolbar/paper-toolbar.html">
  4 +<link rel="import" href="../../bower_components/neon-animation/neon-animated-pages.html">
  5 +<link rel="import" href="../../bower_components/neon-animation/neon-animations.html">
  6 +<link rel="import" href="../list-view-controllet/list-view-controllet.html">
  7 +<link rel="import" href="../full-view-controllet/full-view-controllet.html">
  8 +
  9 +<dom-module id="list-controllet">
  10 +
  11 + <style>
  12 +
  13 + :host {
  14 + display: block;
  15 + }
  16 +
  17 + neon-animated-pages {
  18 + height: 100%;
  19 + }
  20 +
  21 + </style>
  22 +
  23 + <template>
  24 +
  25 + <neon-animated-pages id="pages" selected="0">
  26 +
  27 + <list-view-controllet data="[[data]]" on-item-click="_onItemClick"></list-view-controllet>
  28 +
  29 + <full-view-controllet id="view" on-close="_onClose" datalet="{{selected}}"></full-view-controllet>
  30 +
  31 + </neon-animated-pages>
  32 +
  33 + </template>
  34 +
  35 +</dom-module>
  36 +
  37 +
  38 +
  39 +<script>
  40 +
  41 + Polymer({
  42 +
  43 + is: 'list-controllet',
  44 +
  45 + properties: {
  46 +
  47 + data: {
  48 + type: Array,
  49 + value: []
  50 + }
  51 + },
  52 +
  53 + _onItemClick: function(e) {
  54 + this.$.pages.selected = 1;
  55 + this.$.view.$.main.innerHTML = this.data[parseInt(e.detail.item.id)].html;
  56 + },
  57 +
  58 + _onClose: function() {
  59 + this.$.pages.selected = 0;
  60 + }
  61 +
  62 + });
  63 +
  64 +</script>
... ...
controllets/list-view-controllet/list-view-controllet.html 0 → 100644
  1 +<link rel="import" href="../../bower_components/polymer/polymer.html">
  2 +<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">
  3 +<link rel="import" href="../../bower_components/iron-icon/iron-icon.html">
  4 +<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
  5 +<link rel="import" href="../../bower_components/paper-item/paper-item.html">
  6 +<link rel="import" href="../../bower_components/paper-item/paper-item-body.html">
  7 +<link rel="import" href="../../bower_components/paper-styles/paper-styles.html">
  8 +<link rel="import" href="../../bower_components/neon-animation/neon-animatable-behavior.html">
  9 +
  10 +<dom-module id="list-view-controllet">
  11 +
  12 + <style>
  13 +
  14 + :host {
  15 + @apply(--layout-vertical);
  16 + }
  17 +
  18 + .main {
  19 + @apply(--layout-flex);
  20 + @apply(--layout-scroll);
  21 + }
  22 +
  23 + iron-icon {
  24 + color: var(--google-grey-500);
  25 + }
  26 +
  27 + </style>
  28 +
  29 + <template>
  30 +
  31 + <paper-toolbar class="small-tall" style="background: #2196F3;">
  32 + <paper-icon-button id="button" icon="arrow-back"></paper-icon-button>
  33 + <span>Datalets list - examples</span>
  34 + </paper-toolbar>
  35 +
  36 + <div class="main">
  37 +
  38 + <template is="dom-repeat" items="[[data]]" index-as="i">
  39 +
  40 + <paper-item id="{{i}}">
  41 + <paper-item-body two-line>
  42 + <div>[[item.name]]</div>
  43 + <div secondary>[[item.description]]</div>
  44 + </paper-item-body>
  45 + </paper-item>
  46 +
  47 + </template>
  48 +
  49 + </div>
  50 +
  51 + </template>
  52 +
  53 +</dom-module>
  54 +
  55 +<script>
  56 +
  57 + Polymer({
  58 +
  59 + is: 'list-view-controllet',
  60 +
  61 + behaviors: [
  62 + Polymer.NeonAnimatableBehavior
  63 + ],
  64 +
  65 + listeners: {
  66 + 'click': '_onClick'
  67 + },
  68 +
  69 + properties: {
  70 +
  71 + data: {
  72 + type: Array,
  73 + value: []
  74 + },
  75 +
  76 + animationConfig: {
  77 + type: Object,
  78 + value: function() {
  79 + return {
  80 + 'entry': [{
  81 + name: 'fade-in-animation',
  82 + node: this.$.button
  83 + }],
  84 +
  85 + 'exit': [{
  86 + name: 'fade-out-animation',
  87 + node: this.$.button
  88 + }, {
  89 + name: 'hero-animation',
  90 + id: 'hero',
  91 + fromPage: this
  92 + }]
  93 + };
  94 + }
  95 + }
  96 +
  97 + },
  98 +
  99 + _onClick: function(event) {
  100 + var target = event.target;
  101 + while (target !== this && !target._templateInstance) {
  102 + target = target.parentNode;
  103 + }
  104 +
  105 + // configure the page animation
  106 + this.sharedElements = {
  107 + 'hero': target,
  108 + };
  109 +
  110 + this.fire('item-click', {
  111 + item: target,
  112 + });
  113 + }
  114 +
  115 + });
  116 +
  117 +</script>
... ...
controllets/text-element-controllet/docs.html 0 → 100644
  1 +<!DOCTYPE html>
  2 +<html lang="en">
  3 +<head>
  4 + <link rel="import" href="../../bower_components/iron-component-page/iron-component-page.html">
  5 +
  6 + <meta charset="UTF-8">
  7 +</head>
  8 +<body>
  9 +
  10 +<iron-component-page src="text-element-controllet.html" ></iron-component-page>
  11 +
  12 +</body>
  13 +</html>
0 14 \ No newline at end of file
... ...
datalets/base-ajax-json-jsonpath-datalet/static/js/AjaxJsonJsonPathBehavior.json
... ... @@ -4,7 +4,7 @@
4 4 "behaviors": [
5 5 {
6 6 "type": "behaviour",
7   - "desc": "Defined in `AjaxJsonJsonPathBehaviour.js`. Itos a specific implemetation that uses Ajax to get the data in Json format and uses JsonPath to select and filtering the data",
  7 + "desc": "Defined in `AjaxJsonJsonPathBehaviour.js`. It is a specific implemetation that uses Ajax to get the data in Json format and uses JsonPath to select and filtering the data",
8 8 "events": [],
9 9 "properties": [
10 10 {
... ...
demo.html 0 → 100644
  1 +<!DOCTYPE html>
  2 +<html lang="en">
  3 +<head>
  4 + <link rel="import" href="bower_components/iron-component-page/iron-component-page.html">
  5 + <link rel="import" href="bower_components/paper-drawer-panel/paper-drawer-panel.html">
  6 + <link rel="import" href="bower_components/paper-menu/paper-menu.html">
  7 + <link rel="import" href="bower_components/paper-item/paper-item.html">
  8 + <link rel="import" href="bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
  9 + <link rel="import" href="bower_components/paper-icon-button/paper-icon-button.html">
  10 + <link rel="import" href="bower_components/paper-styles/color.html">
  11 + <link rel="import" href="bower_components/paper-input/paper-textarea.html">
  12 + <link rel="import" href="bower_components/iron-flex-layout/iron-flex-layout.html">
  13 + <link rel="import" href="bower_components/iron-ajax/iron-ajax.html">
  14 +
  15 + <link rel="import" href="controllets/items-slider-controllet/items-slider-controllet.html">
  16 + <link rel="import" href="controllets/draggable-element-controllet/draggable-element-controllet.html">
  17 + <link rel="import" href="controllets/treeview-controllet/treeview-controllet.html">
  18 + <link rel="import" href="controllets/text-element-controllet/text-element-controllet.html">
  19 +
  20 + <script type="text/javascript" src="datalets/shared_js/jquery-1.11.2.min.js"></script>
  21 + <script type="text/javascript" src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
  22 + <script src="controllets/shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>
  23 + <script src="../DEEPCLIENT/js/deepClient.js"></script>
  24 + <script type="text/javascript" src="docs/js/editarea_0_8_2/edit_area/edit_area_full.js"></script>
  25 +
  26 + <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
  27 + <link rel="stylesheet" href="controllets/shared_js/perfect-scrollbar/css/perfect-scrollbar.min.css">
  28 + <link rel="import" href="bower_components/paper-menu-button/paper-menu-button.html">
  29 + <meta charset="UTF-8">
  30 +
  31 +
  32 + <script type="text/javascript">
  33 + selected_component_url = "";
  34 +
  35 + $(document).ready(function () {
  36 + window.addEventListener("treeview-controllet_fileds-selected", DEEP._fieldsSelected, false);
  37 + window.addEventListener("items-slider-controllet_item-selected", DEEP._dataletSelected, false);
  38 + window.addEventListener("draggable-element-controllet_content-dragged", DEEP._fieldsMapped, false);
  39 + window.addEventListener("text-element-controllet_content-changed", DEEP._textElementChanged, false);
  40 +
  41 + editAreaLoader.init({
  42 + id : "sbiricuda" // textarea id
  43 + ,syntax: "html" // syntax to be uses for highgliting
  44 + ,start_highlight: true // to display with highlight mode on start-up
  45 + ,syntax: "html"
  46 + ,replace_tab_by_spaces: 4,
  47 + isEditable : false,
  48 + });
  49 + });
  50 + </script>
  51 +
  52 + <style>
  53 + body {
  54 + font-family: 'Roboto', sans-serif;
  55 + }
  56 +
  57 + .avatar
  58 + {
  59 + display: inline-block;
  60 + height: 0.5em;
  61 + width: 0.5em;
  62 + border-radius: 50%;
  63 + /*background: #3f51b5;*/
  64 + color: white;
  65 + line-height: 2em;
  66 + font-size: 1.87em;
  67 + text-align: center;
  68 + margin-right: 5px;
  69 + }
  70 +
  71 + #toolbar{
  72 + background: #2196F3 ;
  73 + }
  74 + #logo{
  75 + width: 56px;
  76 + height: 56px;
  77 + background-image: url("http://spod.routetopa.eu/ow_static/themes/rtpa_matter/images/logo.png");
  78 + background-size: auto 41px;
  79 + background-repeat: no-repeat;
  80 + background-position: center center;
  81 +
  82 + }
  83 + .area_container
  84 + {
  85 + overflow: hidden;
  86 + margin : 0.8em;
  87 + padding : 0.8em;
  88 + border-width: 1em;
  89 + border-radius: 0.125rem;
  90 + box-shadow: 0.125em 0.125em 0.1125em 0.125em rgba(0, 0, 0, 0.25);
  91 + }
  92 +
  93 + #visualization_slider_area
  94 + {
  95 + min-width: 566px;
  96 + min-height: 200px;
  97 + height: 175px;
  98 + }
  99 + .content-card {
  100 + position: relative;
  101 + float: left;
  102 + margin: .2em;
  103 + width: 14%;
  104 + min-height: 100px;
  105 + height: 40%;
  106 + background: #fff;
  107 + -moz-border-radius: 0.125rem;
  108 + -webkit-border-radius: 0.125rem;
  109 + border-radius: 0.125rem;
  110 + box-shadow: 0 0.625em 0.5125em 0 rgba(0, 0, 0, 0.25);
  111 + -webkit-box-shadow: 0 0.625em 0.5125em 0 rgba(0, 0, 0, 0.25);
  112 + -moz-box-shadow: 0 0.625em 0.5125em 0 rgba(0, 0, 0, 0.25);
  113 + padding: 1em;
  114 + }
  115 +
  116 + .content-selected{
  117 + position: relative;
  118 + float: left;
  119 + top : 5%;
  120 + margin : .2em;
  121 + width: 14%;
  122 + height: 40%;
  123 +
  124 + background: #fff;
  125 + border-style: solid;
  126 + border-width: 0.03em;
  127 + -moz-border-radius: 0.125rem;; /* Firefox */
  128 + -webkit-border-radius: 0.125rem;; /* Safari, Chrome */
  129 + border-radius: 0.125rem;
  130 + box-shadow: 0 1.825em 1.7125em 0 rgba(0, 0, 0, 0.50);
  131 + -webkit-box-shadow: 0 1.825em 1.7125em 0 rgba(0, 0, 0, 0.50);
  132 + -moz-box-shadow: 0 1.825em 1.7125em 0 rgba(0, 0, 0, 0.50);
  133 + padding: 1em;
  134 + }
  135 +
  136 + </style>
  137 +
  138 +</head>
  139 +<body unresolved>
  140 +
  141 +<template id="DEEP" is="dom-bind">
  142 +
  143 + <iron-ajax
  144 + auto
  145 + id="data_request"
  146 + url="http://ckan.routetopa.eu/api/action/datastore_search?resource_id=07843fc3-07e1-4c66-9be4-fed43ca4a26f"
  147 + verbose="true"
  148 + on-response="handleResponseData"
  149 + debounce-duration="300">
  150 + </iron-ajax>
  151 +
  152 + <iron-ajax
  153 + id="datales_list_request"
  154 + auto
  155 + url={{datasetsList}}
  156 + handle-as="json"
  157 + on-response="handleResponseDatalets"
  158 + debounce-duration="300">
  159 + </iron-ajax>
  160 +
  161 + <iron-ajax
  162 + id="selected_datalet_request"
  163 + url={{deepUrl}}
  164 + verbose="true"
  165 + on-response="handleSelectedDatalet"
  166 + debounce-duration="300">
  167 + </iron-ajax>
  168 +
  169 + <paper-toolbar id="toolbar">
  170 + <paper-menu-button>
  171 + <paper-icon-button icon="menu" class="dropdown-trigger"></paper-icon-button>
  172 + <paper-menu class="dropdown-content">
  173 + <paper-item><a href="http://routetopa.eu/" target="_blank">ROUTE-TO PA European Project</a></paper-item>
  174 + <paper-item><a href="docs/docs.html" target="_blank">DEEP Documentation</a></paper-item>
  175 + </paper-menu>
  176 + </paper-menu-button>
  177 + <span class="title">DatalEts-Ecosystem Provider - Datalet Creator</span>
  178 + <a href="http://routetopa.eu/" target="_blank"><paper-icon-button id="logo" ></paper-icon-button></a>
  179 + </paper-toolbar>
  180 + <div id="main_content">
  181 + <div class="vertical justified layout" style="margin-top: 40px;">
  182 +
  183 + <div class="horizontal layout area_container">
  184 + <p>
  185 + Using this page you can create a Datalet, a off-the-shelf, reusable web-component able to load,
  186 + query, filter, and visualise any dataset content (e.g. through HighCharts Javascript library).
  187 + Datalet are reusable since they can be placed in every web page, like institutional web-sites,
  188 + blogs, forums and so on, without any knowledge on how it effectively is implemented.
  189 + </p>
  190 + </div>
  191 +
  192 + <div class="horizontal layout">
  193 + <paper-textarea style="width: 80%;margin-top: 8px;" id="data_url" label="Dataset api data url" floatingLabel value="http://ckan.routetopa.eu/api/action/datastore_search?resource_id=07843fc3-07e1-4c66-9be4-fed43ca4a26f" on-change="_textElementChanged"></paper-textarea>
  194 + <paper-dropdown-menu style="width: 20%;" id="datasets-sources" label="Example datasets">
  195 + <paper-menu class="dropdown-content">
  196 + <template is="dom-repeat" items="[[Datasets.names]]" as="dataset" index-as="i">
  197 + <paper-item id="[[i]]" on-tap="_datasourceSelected">[[dataset]]</paper-item>
  198 + </template>
  199 + </paper-menu>
  200 + </paper-dropdown-menu>
  201 + </div>
  202 +
  203 + <div class="horizontal layout">
  204 +
  205 + <div style="position:relative;width: 50%;min-height: 40vh;max-height: 40vh;" id="fields_placeholder" class="area_container flexchild" style="min-width:300px">
  206 + <treeview-controllet id="fields_treeview"></treeview-controllet>
  207 + </div>
  208 +
  209 + <div style="position:relative;width: 50%;min-height: 40vh;max-height: 40vh;" id="table_fields_container" class="area_container flex2child">
  210 + <div id="table_component_place_holder"></div>
  211 + </div>
  212 +
  213 + </div>
  214 +
  215 + <div class="horizontal layout">
  216 +
  217 + <div style="position:relative;width: 50%;min-height: 80vh;max-height: 80vh;" id="datalet_params_main_placeholder" class="area_container flexchild" style="min-width:300px">
  218 + <div class="">
  219 + <div id="visualization_slider_area" class="area_container"></div>
  220 + <div id="fields_mapping_area" class="area_container horizontal layout">
  221 +
  222 + <div id="selected_fields_main_container" class="field-mapping-card" style="position:relative;width: 50%;min-height: 40vh;max-height: 40vh;">
  223 + <div class="title">
  224 + <div class="medium">Selected fields</div>
  225 + </div>
  226 + <div id="selected_fields_container" class="area_container"></div>
  227 + </div>
  228 +
  229 + <div id="idm_fields_main_container" class="field-mapping-card" style="position:relative;width: 50%;min-height: 40vh;max-height: 40vh;">
  230 + <div class="title">
  231 + <div class="medium">Datalet fields</div>
  232 + </div>
  233 + <div id="datalet_idm_fields_container" class="area_container"></div>
  234 + </div>
  235 + </div>
  236 + <div id="idm_layout_main_container" class="area_container" style="position:relative;min-height: 20vh;max-height: 20vh;">
  237 + <div class="title">
  238 + <div class="medium">Layout fields</div>
  239 + </div>
  240 + <div id="idm_layout_container" class="area_container"></div>
  241 + </div>
  242 + </div>
  243 +
  244 + </div>
  245 +
  246 + <div style="position:relative;width: 50%;min-height: 80vh;max-height: 80vh;" id="datalet_main_container" class="area_container flex2child">
  247 + </div>
  248 +
  249 + </div>
  250 +
  251 + <div class="horizontal layout">
  252 + <div id="code_area" style="position:relative;width: 100%;min-height: 20vh;max-height: 20vh;" class="area_container flex2child">
  253 + <textarea id="sbiricuda" style="position:relative;width: 100%;min-height: 20vh;max-height: 20vh;" style="" rows="4" cols="50">
  254 + Copy and paste this code to inject the datalet in you page.
  255 + </textarea>
  256 + </div>
  257 + </div>
  258 +
  259 + </div>
  260 +
  261 + </div>
  262 +</template>
  263 +<script>
  264 +
  265 + DEEP.deepUrl = "http://deep.routetopa.eu/DEEP/";
  266 + DEEP.datasetsList = "http://deep.routetopa.eu/DEEP/datalets-list";
  267 +
  268 + DEEP.Datasets = {
  269 + names:[
  270 + 'Italy - Consuntivo entrate 2009',
  271 + 'Italy - Consuntivo entrate 2010',
  272 + 'Italy - Consuntivo entrate 2011',
  273 + 'Italy - Consuntivo entrate 2012',
  274 + 'Italy - Consuntivo entrate 2014',
  275 + 'Holland - Vestigingen register gemeente Groningen',
  276 + 'Holland - Woonruimte gemeente Groningen',
  277 + 'Ireland - SDCC Traffic Cameras',
  278 + 'Ireland - Derelict Site Register',
  279 + 'Ireland - Dublin City Council Commencement Notices',
  280 + 'Ireland - Dublin City Council Planning Applications',
  281 + 'Ireland - Dun Laoghaire-Rathdown County Council Planning Application 2008-2014',
  282 + 'Ireland - Fingal Council Planning Applications for last 7 years',
  283 + 'Ireland - Planning Register',
  284 + 'Ireland - Fingal Development Plan 2011-2017 Record of Protected Structures'
  285 + ],
  286 + urls: [
  287 + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=07843fc3-07e1-4c66-9be4-fed43ca4a26f',
  288 + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=48a4db73-d3d4-4639-bbc2-9c797d0e6cda',
  289 + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=a14cc2fb-0c24-48d7-9370-834045797d89',
  290 + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=fb32fcb6-5e44-4e52-b132-01c6540ddbee',
  291 + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=0cb600fc-19ad-4aaf-9794-1e6ea851840a',
  292 + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=ba554c1f-02a7-4d76-b449-fb9daa1f8bfd',
  293 + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=af7b3916-4347-469a-8354-3c2d559bd92f',
  294 + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=73e02092-85a1-434e-85fe-0c9a43aa9a52',
  295 + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=fcbee83e-3d3d-4303-a568-24dd33d02adc',
  296 + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=ee00de68-f2e4-482f-a003-3c0561351075',
  297 + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=2f4a9d44-b52f-4c8b-a5db-d8f4a676d81e',
  298 + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=c479f061-9638-489d-ac55-0c68765548ff',
  299 + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=d29a477a-4734-43ef-8002-048c8640d441',
  300 + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=2b23f32d-e27e-4eef-af1e-27e05103df7d',
  301 + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=5ea813bc-fdf9-4edb-b3b1-0142b593d5c6'
  302 + ]
  303 + };
  304 +
  305 + DEEP.handleResponseData = function(e){
  306 + DEEP.$.fields_treeview.init(e.detail.response);
  307 + $("#fields_placeholder").perfectScrollbar();
  308 + $("#table_fields_container").perfectScrollbar();
  309 + };
  310 +
  311 + DEEP.handleResponseDatalets = function(e){
  312 + DEEP.datalets_list = new Array();
  313 + for(var i=0;i < e.detail.response.length;i++){
  314 + var datalet_info = { name : e.detail.response[i].name ,
  315 + image : e.detail.response[i].url + e.detail.response[i].name + ".png"
  316 + };
  317 +
  318 + DEEP.datalets_list.push(datalet_info);
  319 + }
  320 +
  321 + DEEP.$.visualization_slider_area.innerHTML = '<items-slider-controllet items=\'' + JSON.stringify(DEEP.datalets_list) + '\'' +
  322 + '\'></items-slider-controllet>';
  323 + };
  324 +
  325 + DEEP.handleSelectedDatalet = function(e){
  326 +
  327 + var response = e.detail.response;
  328 + DEEP.$.datalet_idm_fields_container.innerHTML = "";
  329 + DEEP.$.idm_layout_container.innerHTML = "";
  330 +
  331 + if(response.idm.inputs.input.constructor == Object) {
  332 + var input = response.idm.inputs.input;
  333 + if(input.selection == "*") {
  334 + var input_selected_fields = Polymer.dom(DEEP.$.selected_fields_container).querySelectorAll('draggable-element-controllet');
  335 + for (var j = 0; j < input_selected_fields.length; j++) {
  336 + DEEP.$.datalet_idm_fields_container.innerHTML += '<draggable-element-controllet is-target="true" heading="Field ' + (j + 1) + '" description="' + input.description + '" number="' + (j + 1) + '"></draggable-element-controllet><br>';
  337 + }
  338 + }
  339 + }else{
  340 + for(var i =0; i < response.idm.inputs.input.length; i++){
  341 + var input = response.idm.inputs.input[i];
  342 + DEEP.$.datalet_idm_fields_container.innerHTML += '<draggable-element-controllet is-target="true" id="' + input.name + '" heading="' + input.name + '" description="' + input.description + '" number="' + (i + 1) + '"></draggable-element-controllet><br>';
  343 + }
  344 + }
  345 +
  346 + if(response.idm.inputs.layouts.input.constructor == Object) {
  347 + var input = response.idm.inputs.layouts.input;
  348 + DEEP.$.idm_layout_container.innerHTML += '<text-element-controllet heading="' + input.name + '" description="' + input.description + '" number="1"></text-element-controllet>';
  349 + }else{
  350 + for(var i =0; i < response.idm.inputs.layouts.input.length; i++){
  351 + var input = response.idm.inputs.layouts.input[i];
  352 + DEEP.$.idm_layout_container.innerHTML += '<text-element-controllet heading="' + input.name + '" ' +
  353 + 'description="' + input.description + '" ' +
  354 + 'number="' + (i+1) + '">' +
  355 + '</text-element-controllet>';
  356 + }
  357 + }
  358 +
  359 + $("#selected_fields_main_container").perfectScrollbar();
  360 + $("#idm_fields_main_container").perfectScrollbar();
  361 + $("#idm_layout_main_container").perfectScrollbar();
  362 + $("#datalet_params_main_placeholder").perfectScrollbar();
  363 + };
  364 +
  365 + DEEP._urlChanged = function(event){
  366 + DEEP.$.data_request.url = event.target.value;
  367 + DEEP.$.data_request.generateRequest();
  368 + DEEP.$.table_component_place_holder.innerHTML = "";
  369 + };
  370 +
  371 + DEEP._datasourceSelected = function(event){
  372 + DEEP.$.data_url.value = DEEP.Datasets.urls[parseInt(event.target.id)];
  373 + DEEP.$.data_request.url = DEEP.Datasets.urls[parseInt(event.target.id)];
  374 + DEEP.$.data_request.generateRequest();
  375 + DEEP.$.table_component_place_holder.innerHTML = "";
  376 + };
  377 +
  378 + DEEP._fieldsSelected = function(e){
  379 +
  380 + DEEP.$.selected_fields_container.innerHTML = "";
  381 + for(var i=0;i<e.detail.fields.length;i++) {
  382 + DEEP.$.selected_fields_container.innerHTML += '<draggable-element-controllet identifier="' + e.detail.fields[i] +
  383 + '" label="' + e.detail.fields[i].split(",")[e.detail.fields[i].split(",").length -1] +
  384 + '"></draggable-element-controllet><br>';
  385 + }
  386 +
  387 + ComponentService.deep_url = DEEP.deepUrl;
  388 +
  389 + ComponentService.getComponent({
  390 + component : "datatable-datalet",
  391 + params :{
  392 + 'data-url' : DEEP.$.data_url.value
  393 + },
  394 + fields : e.detail.fields,
  395 + placeHolder : DEEP.$.table_component_place_holder
  396 + });
  397 +
  398 + };
  399 +
  400 + DEEP._dataletSelected = function(e){
  401 + DEEP.selected_datalet = e.detail.datalet;
  402 + DEEP.$.selected_datalet_request.url = DEEP.deepUrl + e.detail.datalet;
  403 + DEEP.$.selected_datalet_request.generateRequest();
  404 + };
  405 +
  406 + DEEP._fieldsMapped = function(e){
  407 + DEEP.generateDataletPreview();
  408 + };
  409 +
  410 + DEEP.timer = 0;
  411 + DEEP._textElementChanged = function(e){
  412 + clearTimeout (DEEP.timer);
  413 + DEEP.timer = setTimeout(DEEP.generateDataletPreview, 1500);
  414 + };
  415 +
  416 + DEEP.getXMLHttpRequest = function()
  417 + {
  418 + if (window.XMLHttpRequest) {
  419 + return new XMLHttpRequest();
  420 + }
  421 + else {
  422 + try {
  423 + return new ActiveXObject("MSXML2.XMLHTTP.3.0");
  424 + }
  425 + catch(ex) {
  426 + return null;
  427 + }
  428 + }
  429 + };
  430 +
  431 + DEEP.generateDataletPreview = function(){
  432 +
  433 + var input_mapped_fields = Polymer.dom(DEEP.$.datalet_idm_fields_container).querySelectorAll('draggable-element-controllet[is-target=true]');
  434 + DEEP.selected_fields = Array();
  435 +
  436 + for (var i = 0; i < input_mapped_fields.length; i++) {
  437 + if (input_mapped_fields[i].value != "") {
  438 + DEEP.selected_fields.push(input_mapped_fields[i].value);
  439 + }
  440 + }
  441 +
  442 + var input_layouts_fields = Polymer.dom(DEEP.$.idm_layout_container).querySelectorAll('text-element-controllet');
  443 + DEEP.params_fields = {'data-url' : DEEP.$.data_url.value};
  444 +
  445 + for (var i = 0; i < input_layouts_fields.length; i++) {
  446 + if (input_layouts_fields[i].value != "") {
  447 + DEEP.params_fields[input_layouts_fields[i].heading] = input_layouts_fields[i].value;
  448 + }
  449 + }
  450 +
  451 + ComponentService.deep_url = DEEP.deepUrl;
  452 + ComponentService.getComponent({
  453 + component : DEEP.selected_datalet,
  454 + params : DEEP.params_fields,
  455 + fields : DEEP.selected_fields,
  456 + placeHolder : DEEP.$.datalet_main_container
  457 + });
  458 +
  459 + var request = DEEP.getXMLHttpRequest();
  460 +
  461 + request.onreadystatechange = function(){
  462 + if(request.readyState == 4){
  463 + try {
  464 + var resp = JSON.parse(request.response);
  465 + var link = '<link rel="import" href="' + resp.bridge_link + resp.component_link +'">\n';
  466 +
  467 + //Build datalet injecting html code
  468 + var datalet_code = link + '<' + DEEP.selected_datalet;
  469 + var keys = Object.keys(DEEP.params_fields);
  470 + for(var i = 0; i < keys.length; i++){
  471 + datalet_code += ' ' + keys[i] + '=\'' + DEEP.params_fields[keys[i]] +'\'';
  472 + }
  473 + datalet_code += " fields='" + JSON.stringify(DEEP.selected_fields) + "'></" + DEEP.selected_datalet + ">";
  474 +
  475 + DEEP.$.code_area.innerHTML = '<textarea id="sbiricuda" style="position:relative;width: 100%;min-height: 20vh;max-height: 20vh;" style="" rows="4" cols="50" autofocus="false">' +
  476 + '<!-- ADD THE POLYFILL TO YOUR PAGE - https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.14/webcomponents.min.js -->\n' + datalet_code +
  477 + '</textarea>';
  478 +
  479 + editAreaLoader.init({
  480 + id : "sbiricuda" // textarea id
  481 + ,syntax: "html" // syntax to be uses for highgliting
  482 + ,start_highlight: true // to display with highlight mode on start-up
  483 + ,syntax: "html"
  484 + ,replace_tab_by_spaces: 4,
  485 + isEditable : false,
  486 + });
  487 +
  488 + } catch (e){
  489 + var resp = {
  490 + status: 'error',
  491 + data: 'Unknown error occurred: [' + request.response + ']'
  492 + };
  493 + }
  494 + }};
  495 +
  496 + request.open('GET', DEEP.deepUrl + DEEP.selected_datalet);
  497 + request.send();
  498 +
  499 + };
  500 +
  501 +</script>
  502 +
  503 +</body>
  504 +</html>
0 505 \ No newline at end of file
... ...
docs/ROUTETOPADataletDeveloperGuidev0.1.html
1   -<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><style type="text/css">@import url('https://themes.googleusercontent.com/fonts/css?kit=lhDjYqiy3mZ0x6ROQEUoUw');.lst-kix_caqenjpjbamt-2>li:before{content:"\0025a0 "}.lst-kix_caqenjpjbamt-1>li:before{content:"\0025cb "}.lst-kix_caqenjpjbamt-3>li:before{content:"\0025cf "}.lst-kix_caqenjpjbamt-0>li:before{content:"\0025cf "}.lst-kix_caqenjpjbamt-4>li:before{content:"\0025cb "}.lst-kix_caqenjpjbamt-6>li:before{content:"\0025cf "}.lst-kix_caqenjpjbamt-5>li:before{content:"\0025a0 "}.lst-kix_caqenjpjbamt-7>li:before{content:"\0025cb "}.lst-kix_caqenjpjbamt-8>li:before{content:"\0025a0 "}ol.lst-kix_cktmoc41t532-0.start{counter-reset:lst-ctn-kix_cktmoc41t532-0 0}.lst-kix_w0lbiu9bsebc-1>li:before{content:"\0025cb "}.lst-kix_w0lbiu9bsebc-2>li:before{content:"\0025a0 "}ol.lst-kix_cktmoc41t532-6.start{counter-reset:lst-ctn-kix_cktmoc41t532-6 0}.lst-kix_w0lbiu9bsebc-0>li:before{content:"\0025cf "}.lst-kix_mwbvd56bd501-5>li:before{content:"\0025a0 "}ol.lst-kix_cktmoc41t532-1.start{counter-reset:lst-ctn-kix_cktmoc41t532-1 0}.lst-kix_23werwvisbhd-0>li:before{content:"\0025cf "}.lst-kix_w0lbiu9bsebc-7>li:before{content:"\0025cb "}.lst-kix_23werwvisbhd-1>li:before{content:"\0025cb "}.lst-kix_mwbvd56bd501-6>li:before{content:"\0025cf "}.lst-kix_w0lbiu9bsebc-6>li:before{content:"\0025cf "}.lst-kix_23werwvisbhd-3>li:before{content:"\0025cf "}.lst-kix_23werwvisbhd-4>li:before{content:"\0025cb "}.lst-kix_w0lbiu9bsebc-3>li:before{content:"\0025cf "}.lst-kix_w0lbiu9bsebc-5>li:before{content:"\0025a0 "}.lst-kix_mwbvd56bd501-7>li:before{content:"\0025cb "}.lst-kix_23werwvisbhd-2>li:before{content:"\0025a0 "}.lst-kix_mwbvd56bd501-8>li:before{content:"\0025a0 "}.lst-kix_w0lbiu9bsebc-4>li:before{content:"\0025cb "}.lst-kix_23werwvisbhd-7>li:before{content:"\0025cb "}.lst-kix_23werwvisbhd-8>li:before{content:"\0025a0 "}.lst-kix_23werwvisbhd-5>li:before{content:"\0025a0 "}.lst-kix_23werwvisbhd-6>li:before{content:"\0025cf "}.lst-kix_w0lbiu9bsebc-8>li:before{content:"\0025a0 "}.lst-kix_cktmoc41t532-2>li{counter-increment:lst-ctn-kix_cktmoc41t532-2}ol.lst-kix_cktmoc41t532-7.start{counter-reset:lst-ctn-kix_cktmoc41t532-7 0}.lst-kix_cktmoc41t532-5>li{counter-increment:lst-ctn-kix_cktmoc41t532-5}.lst-kix_iy595p3cktj3-2>li:before{content:"\0025a0 "}.lst-kix_oia1ur76tkla-6>li:before{content:"\0025cf "}.lst-kix_oia1ur76tkla-4>li:before{content:"\0025cb "}.lst-kix_oia1ur76tkla-8>li:before{content:"\0025a0 "}.lst-kix_z1db35cwkqzv-0>li:before{content:"\0025cf "}.lst-kix_z1db35cwkqzv-4>li:before{content:"\0025cb "}.lst-kix_iy595p3cktj3-6>li:before{content:"\0025cf "}ul.lst-kix_xpt451iyqej1-5{list-style-type:none}ul.lst-kix_xpt451iyqej1-4{list-style-type:none}ul.lst-kix_xpt451iyqej1-3{list-style-type:none}ul.lst-kix_xpt451iyqej1-2{list-style-type:none}.lst-kix_iy595p3cktj3-4>li:before{content:"\0025cb "}.lst-kix_cktmoc41t532-4>li{counter-increment:lst-ctn-kix_cktmoc41t532-4}ul.lst-kix_xpt451iyqej1-8{list-style-type:none}ul.lst-kix_xpt451iyqej1-7{list-style-type:none}ul.lst-kix_xpt451iyqej1-6{list-style-type:none}.lst-kix_z1db35cwkqzv-6>li:before{content:"\0025cf "}.lst-kix_xpt451iyqej1-5>li:before{content:"\0025a0 "}.lst-kix_z1db35cwkqzv-8>li:before{content:"\0025a0 "}.lst-kix_iy595p3cktj3-8>li:before{content:"\0025a0 "}.lst-kix_cktmoc41t532-3>li{counter-increment:lst-ctn-kix_cktmoc41t532-3}.lst-kix_xpt451iyqej1-7>li:before{content:"\0025cb "}ol.lst-kix_cktmoc41t532-2.start{counter-reset:lst-ctn-kix_cktmoc41t532-2 0}ol.lst-kix_cktmoc41t532-5{list-style-type:none}ol.lst-kix_cktmoc41t532-6{list-style-type:none}ol.lst-kix_cktmoc41t532-7{list-style-type:none}ol.lst-kix_cktmoc41t532-8{list-style-type:none}ul.lst-kix_w0lbiu9bsebc-8{list-style-type:none}ul.lst-kix_w0lbiu9bsebc-6{list-style-type:none}ul.lst-kix_w0lbiu9bsebc-7{list-style-type:none}ol.lst-kix_cktmoc41t532-0{list-style-type:none}ul.lst-kix_w0lbiu9bsebc-4{list-style-type:none}.lst-kix_oia1ur76tkla-0>li:before{content:"\0025cf "}ol.lst-kix_cktmoc41t532-1{list-style-type:none}ul.lst-kix_w0lbiu9bsebc-5{list-style-type:none}ol.lst-kix_cktmoc41t532-2{list-style-type:none}ul.lst-kix_w0lbiu9bsebc-2{list-style-type:none}ol.lst-kix_cktmoc41t532-3{list-style-type:none}ul.lst-kix_w0lbiu9bsebc-3{list-style-type:none}ol.lst-kix_cktmoc41t532-4{list-style-type:none}ul.lst-kix_w0lbiu9bsebc-0{list-style-type:none}.lst-kix_oia1ur76tkla-2>li:before{content:"\0025a0 "}ul.lst-kix_w0lbiu9bsebc-1{list-style-type:none}.lst-kix_iy595p3cktj3-0>li:before{content:"\0025cf "}.lst-kix_mwbvd56bd501-3>li:before{content:"\0025cf "}.lst-kix_z1db35cwkqzv-2>li:before{content:"\0025a0 "}.lst-kix_mwbvd56bd501-1>li:before{content:"\0025cb "}ol.lst-kix_cktmoc41t532-5.start{counter-reset:lst-ctn-kix_cktmoc41t532-5 0}.lst-kix_oldlfkxmjbuj-5>li:before{content:"\0025a0 "}.lst-kix_xpt451iyqej1-1>li:before{content:"\0025cb "}.lst-kix_oldlfkxmjbuj-7>li:before{content:"\0025cb "}.lst-kix_xpt451iyqej1-3>li:before{content:"\0025cf "}ol.lst-kix_cktmoc41t532-4.start{counter-reset:lst-ctn-kix_cktmoc41t532-4 0}ul.lst-kix_xpt451iyqej1-1{list-style-type:none}ul.lst-kix_xpt451iyqej1-0{list-style-type:none}ol.lst-kix_cktmoc41t532-3.start{counter-reset:lst-ctn-kix_cktmoc41t532-3 0}.lst-kix_cktmoc41t532-0>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-0,decimal) ". "}.lst-kix_cktmoc41t532-1>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-1,lower-latin) ". "}.lst-kix_oldlfkxmjbuj-4>li:before{content:"\0025cb "}ul.lst-kix_caqenjpjbamt-4{list-style-type:none}.lst-kix_cktmoc41t532-4>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-4,lower-latin) ". "}ul.lst-kix_caqenjpjbamt-3{list-style-type:none}ul.lst-kix_caqenjpjbamt-6{list-style-type:none}.lst-kix_oldlfkxmjbuj-3>li:before{content:"\0025cf "}ul.lst-kix_caqenjpjbamt-5{list-style-type:none}.lst-kix_j1pbyefbfchs-6>li:before{content:"\0025cf "}ul.lst-kix_caqenjpjbamt-8{list-style-type:none}.lst-kix_cktmoc41t532-2>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-2,lower-roman) ". "}.lst-kix_cktmoc41t532-6>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-6,decimal) ". "}ul.lst-kix_caqenjpjbamt-7{list-style-type:none}.lst-kix_cktmoc41t532-3>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-3,decimal) ". "}.lst-kix_cktmoc41t532-7>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-7,lower-latin) ". "}.lst-kix_oldlfkxmjbuj-2>li:before{content:"\0025a0 "}.lst-kix_j1pbyefbfchs-5>li:before{content:"\0025a0 "}.lst-kix_ucxv06xdi15q-7>li:before{content:"\0025cb "}.lst-kix_oldlfkxmjbuj-1>li:before{content:"\0025cb "}.lst-kix_j1pbyefbfchs-2>li:before{content:"\0025a0 "}.lst-kix_j1pbyefbfchs-4>li:before{content:"\0025cb "}.lst-kix_cktmoc41t532-5>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-5,lower-roman) ". "}.lst-kix_ucxv06xdi15q-8>li:before{content:"\0025a0 "}.lst-kix_oldlfkxmjbuj-0>li:before{content:"\0025cf "}.lst-kix_j1pbyefbfchs-3>li:before{content:"\0025cf "}ul.lst-kix_23werwvisbhd-7{list-style-type:none}ul.lst-kix_23werwvisbhd-8{list-style-type:none}.lst-kix_ucxv06xdi15q-1>li:before{content:"\0025cb "}.lst-kix_ucxv06xdi15q-3>li:before{content:"\0025cf "}.lst-kix_j1pbyefbfchs-0>li:before{content:"\0025cf "}.lst-kix_ucxv06xdi15q-2>li:before{content:"\0025a0 "}.lst-kix_ucxv06xdi15q-6>li:before{content:"\0025cf "}.lst-kix_j1pbyefbfchs-1>li:before{content:"\0025cb "}ul.lst-kix_23werwvisbhd-1{list-style-type:none}.lst-kix_cktmoc41t532-8>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-8,lower-roman) ". "}ul.lst-kix_23werwvisbhd-2{list-style-type:none}ul.lst-kix_23werwvisbhd-0{list-style-type:none}.lst-kix_ucxv06xdi15q-5>li:before{content:"\0025a0 "}ul.lst-kix_23werwvisbhd-5{list-style-type:none}ul.lst-kix_caqenjpjbamt-0{list-style-type:none}ul.lst-kix_23werwvisbhd-6{list-style-type:none}ul.lst-kix_23werwvisbhd-3{list-style-type:none}ul.lst-kix_caqenjpjbamt-2{list-style-type:none}ul.lst-kix_23werwvisbhd-4{list-style-type:none}.lst-kix_ucxv06xdi15q-4>li:before{content:"\0025cb "}ul.lst-kix_caqenjpjbamt-1{list-style-type:none}ul.lst-kix_ucxv06xdi15q-1{list-style-type:none}ul.lst-kix_ucxv06xdi15q-2{list-style-type:none}ul.lst-kix_ucxv06xdi15q-0{list-style-type:none}ul.lst-kix_ucxv06xdi15q-5{list-style-type:none}ul.lst-kix_ucxv06xdi15q-6{list-style-type:none}ul.lst-kix_ucxv06xdi15q-3{list-style-type:none}ul.lst-kix_ucxv06xdi15q-4{list-style-type:none}ul.lst-kix_ucxv06xdi15q-7{list-style-type:none}ul.lst-kix_ucxv06xdi15q-8{list-style-type:none}ol.lst-kix_cktmoc41t532-8.start{counter-reset:lst-ctn-kix_cktmoc41t532-8 0}.lst-kix_j1pbyefbfchs-7>li:before{content:"\0025cb "}.lst-kix_j1pbyefbfchs-8>li:before{content:"\0025a0 "}.lst-kix_cktmoc41t532-8>li{counter-increment:lst-ctn-kix_cktmoc41t532-8}.lst-kix_iy595p3cktj3-1>li:before{content:"\0025cb "}.lst-kix_iy595p3cktj3-3>li:before{content:"\0025cf "}.lst-kix_oia1ur76tkla-5>li:before{content:"\0025a0 "}.lst-kix_oia1ur76tkla-7>li:before{content:"\0025cb "}.lst-kix_z1db35cwkqzv-1>li:before{content:"\0025cb "}.lst-kix_z1db35cwkqzv-3>li:before{content:"\0025cf "}.lst-kix_iy595p3cktj3-5>li:before{content:"\0025a0 "}ul.lst-kix_oldlfkxmjbuj-0{list-style-type:none}.lst-kix_z1db35cwkqzv-5>li:before{content:"\0025a0 "}.lst-kix_z1db35cwkqzv-7>li:before{content:"\0025cb "}ul.lst-kix_oldlfkxmjbuj-1{list-style-type:none}ul.lst-kix_oldlfkxmjbuj-2{list-style-type:none}ul.lst-kix_oldlfkxmjbuj-3{list-style-type:none}ul.lst-kix_oldlfkxmjbuj-4{list-style-type:none}ul.lst-kix_oldlfkxmjbuj-5{list-style-type:none}ul.lst-kix_oia1ur76tkla-1{list-style-type:none}ul.lst-kix_oldlfkxmjbuj-6{list-style-type:none}ul.lst-kix_oia1ur76tkla-2{list-style-type:none}ul.lst-kix_oldlfkxmjbuj-7{list-style-type:none}.lst-kix_xpt451iyqej1-4>li:before{content:"\0025cb "}.lst-kix_xpt451iyqej1-6>li:before{content:"\0025cf "}ul.lst-kix_oldlfkxmjbuj-8{list-style-type:none}ul.lst-kix_oia1ur76tkla-0{list-style-type:none}ul.lst-kix_oia1ur76tkla-5{list-style-type:none}ul.lst-kix_iy595p3cktj3-8{list-style-type:none}ul.lst-kix_oia1ur76tkla-6{list-style-type:none}ul.lst-kix_oia1ur76tkla-3{list-style-type:none}ul.lst-kix_oia1ur76tkla-4{list-style-type:none}ul.lst-kix_iy595p3cktj3-5{list-style-type:none}ul.lst-kix_iy595p3cktj3-4{list-style-type:none}.lst-kix_iy595p3cktj3-7>li:before{content:"\0025cb "}ul.lst-kix_iy595p3cktj3-7{list-style-type:none}ul.lst-kix_oia1ur76tkla-7{list-style-type:none}ul.lst-kix_iy595p3cktj3-6{list-style-type:none}.lst-kix_xpt451iyqej1-8>li:before{content:"\0025a0 "}ul.lst-kix_oia1ur76tkla-8{list-style-type:none}ul.lst-kix_iy595p3cktj3-1{list-style-type:none}ul.lst-kix_iy595p3cktj3-0{list-style-type:none}ul.lst-kix_iy595p3cktj3-3{list-style-type:none}ul.lst-kix_iy595p3cktj3-2{list-style-type:none}.lst-kix_cktmoc41t532-1>li{counter-increment:lst-ctn-kix_cktmoc41t532-1}.lst-kix_oia1ur76tkla-1>li:before{content:"\0025cb "}.lst-kix_oia1ur76tkla-3>li:before{content:"\0025cf "}.lst-kix_mwbvd56bd501-4>li:before{content:"\0025cb "}ul.lst-kix_j1pbyefbfchs-8{list-style-type:none}.lst-kix_mwbvd56bd501-2>li:before{content:"\0025a0 "}ul.lst-kix_mwbvd56bd501-2{list-style-type:none}ul.lst-kix_mwbvd56bd501-3{list-style-type:none}ul.lst-kix_mwbvd56bd501-0{list-style-type:none}ul.lst-kix_mwbvd56bd501-1{list-style-type:none}.lst-kix_mwbvd56bd501-0>li:before{content:"\0025cf "}.lst-kix_cktmoc41t532-7>li{counter-increment:lst-ctn-kix_cktmoc41t532-7}.lst-kix_ucxv06xdi15q-0>li:before{content:"\0025cf "}ul.lst-kix_mwbvd56bd501-8{list-style-type:none}ul.lst-kix_mwbvd56bd501-6{list-style-type:none}ul.lst-kix_mwbvd56bd501-7{list-style-type:none}ul.lst-kix_mwbvd56bd501-4{list-style-type:none}ul.lst-kix_mwbvd56bd501-5{list-style-type:none}ul.lst-kix_j1pbyefbfchs-2{list-style-type:none}.lst-kix_cktmoc41t532-6>li{counter-increment:lst-ctn-kix_cktmoc41t532-6}ul.lst-kix_j1pbyefbfchs-3{list-style-type:none}ul.lst-kix_j1pbyefbfchs-0{list-style-type:none}ul.lst-kix_j1pbyefbfchs-1{list-style-type:none}.lst-kix_cktmoc41t532-0>li{counter-increment:lst-ctn-kix_cktmoc41t532-0}ul.lst-kix_j1pbyefbfchs-6{list-style-type:none}ul.lst-kix_j1pbyefbfchs-7{list-style-type:none}ul.lst-kix_j1pbyefbfchs-4{list-style-type:none}ul.lst-kix_j1pbyefbfchs-5{list-style-type:none}.lst-kix_oldlfkxmjbuj-6>li:before{content:"\0025cf "}ul.lst-kix_z1db35cwkqzv-2{list-style-type:none}ul.lst-kix_z1db35cwkqzv-3{list-style-type:none}ul.lst-kix_z1db35cwkqzv-0{list-style-type:none}.lst-kix_xpt451iyqej1-2>li:before{content:"\0025a0 "}ul.lst-kix_z1db35cwkqzv-1{list-style-type:none}.lst-kix_oldlfkxmjbuj-8>li:before{content:"\0025a0 "}ul.lst-kix_z1db35cwkqzv-8{list-style-type:none}ul.lst-kix_z1db35cwkqzv-6{list-style-type:none}ul.lst-kix_z1db35cwkqzv-7{list-style-type:none}ul.lst-kix_z1db35cwkqzv-4{list-style-type:none}ul.lst-kix_z1db35cwkqzv-5{list-style-type:none}.lst-kix_xpt451iyqej1-0>li:before{content:"\0025cf "}ol{margin:0;padding:0}.c25{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;background-color:#3d85c6;border-left-style:solid;border-bottom-width:1pt;width:114.7pt;border-top-color:#000000;border-bottom-style:solid}.c49{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;background-color:#3d85c6;border-left-style:solid;border-bottom-width:1pt;width:66.8pt;border-top-color:#000000;border-bottom-style:solid}.c46{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;background-color:#3d85c6;border-left-style:solid;border-bottom-width:1pt;width:192.8pt;border-top-color:#000000;border-bottom-style:solid}.c47{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;background-color:#3d85c6;border-left-style:solid;border-bottom-width:1pt;width:77.2pt;border-top-color:#000000;border-bottom-style:solid}.c64{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:66.8pt;border-top-color:#000000;border-bottom-style:solid}.c70{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:77.2pt;border-top-color:#000000;border-bottom-style:solid}.c72{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:114.7pt;border-top-color:#000000;border-bottom-style:solid}.c73{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:192.8pt;border-top-color:#000000;border-bottom-style:solid}.c45{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:225.7pt;border-top-color:#000000;border-bottom-style:solid}.c38{font-weight:normal;text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c51{color:#ffffff;text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c61{text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c27{padding-top:0pt;padding-bottom:0pt;line-height:1.0;text-align:left}.c34{background-color:#2b2b2b;font-size:8pt;font-family:"Courier New";color:#e8bf6a}.c36{background-color:#2b2b2b;font-size:8pt;font-family:"Courier New";color:#9876aa}.c22{background-color:#2b2b2b;font-size:8pt;font-family:"Courier New";color:#cc7832}.c23{background-color:#2b2b2b;font-size:9pt;font-family:"Courier New";color:#e8bf6a}.c60{padding-top:0pt;padding-bottom:0pt;line-height:1.15;text-align:left}.c13{font-size:12pt;font-family:"Trebuchet MS";color:#1155cc;text-decoration:underline}.c43{background-color:#ffffff;color:#1155cc;text-decoration:underline}.c19{padding-top:8pt;padding-bottom:0pt;page-break-after:avoid}.c26{font-size:12pt;font-family:"Trebuchet MS";color:#666666}.c77{background-color:#ffffff;max-width:451.4pt;padding:72pt 72pt 72pt 72pt}.c39{background-color:#2b2b2b;font-family:"Courier New";color:#e8bf6a}.c28{padding-top:10pt;padding-bottom:0pt;page-break-after:avoid}.c54{background-color:#2b2b2b;font-family:"Courier New";color:#9876aa}.c57{background-color:#344134;font-family:"Courier New";color:#a9b7c6}.c21{border-collapse:collapse;margin-right:auto}.c74{background-color:#f9f2f4;font-size:10pt;color:#c7254e}.c0{font-size:9pt;font-family:"Consolas";color:#006666}.c1{orphans:2;widows:2;direction:ltr}.c52{font-size:21pt;font-family:"Trebuchet MS"}.c75{line-height:1.15;text-align:left}.c44{color:#1155cc;text-decoration:underline}.c53{background-color:#ffffff;color:#222222}.c11{margin-left:72pt;padding-left:0pt}.c67{font-size:8pt;color:#e8bf6a}.c18{padding:0;margin:0}.c24{font-size:13pt;font-family:"Trebuchet MS"}.c71{padding-bottom:0pt;text-align:center}.c69{background-color:#ffffff;color:#0086b3}.c59{font-size:16pt;font-family:"Trebuchet MS"}.c56{background-color:#ffffff;color:#000080}.c55{background-color:#ffffff;color:#dd1144}.c33{background-color:#ffffff;color:#212121}.c15{color:inherit;text-decoration:inherit}.c76{font-size:8pt;color:#cc7832}.c42{background-color:#ffffff;color:#333333}.c2{font-size:9pt;font-family:"Consolas"}.c3{margin-left:36pt;padding-left:0pt}.c10{margin-left:36pt}.c30{height:20pt}.c29{page-break-after:avoid}.c6{color:#660066}.c50{text-indent:36pt}.c12{line-height:1.5}.c14{height:0pt}.c8{color:#000088}.c31{line-height:1.0}.c58{text-align:justify}.c32{margin-left:18pt}.c63{background-color:#2b2b2b}.c35{font-size:12pt}.c5{color:#000000}.c20{font-weight:bold}.c7{height:11pt}.c37{height:14pt}.c65{padding-bottom:10pt}.c9{color:#880000}.c62{font-size:13pt}.c4{color:#666600}.c41{font-family:"Consolas"}.c68{font-family:"Trebuchet MS"}.c40{margin-left:54pt}.c16{font-style:italic}.c48{direction:ltr}.c66{text-decoration:underline}.c17{color:#008800}.title{padding-top:0pt;color:#000000;font-size:26pt;padding-bottom:3pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}.subtitle{padding-top:0pt;color:#666666;font-size:15pt;padding-bottom:16pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}li{color:#000000;font-size:11pt;font-family:"Arial"}p{margin:0;color:#000000;font-size:11pt;font-family:"Arial"}h1{padding-top:20pt;color:#000000;font-size:20pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h2{padding-top:18pt;color:#000000;font-size:16pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h3{padding-top:16pt;color:#434343;font-size:14pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h4{padding-top:14pt;color:#666666;font-size:12pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h5{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h6{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;font-style:italic;orphans:2;widows:2;text-align:left}</style></head><body class="c77"><p class="c1 c29 c71 title"><a name="h.pkp3s2laag2t"></a><span class="c52">ROUTE-TO-PA Datalet Developer Guide</span></p><p class="c1 c7 c65"><span></span></p><a href="#" name="ac16fd65acb962b3dcde43864cc851d202c45178"></a><a href="#" name="0"></a><table cellpadding="0" cellspacing="0" class="c21"><tbody><tr class="c14"><td class="c49" colspan="1" rowspan="1"><p class="c27 c48"><span class="c51 c20">Revision</span></p></td><td class="c47" colspan="1" rowspan="1"><p class="c27 c48"><span class="c20 c51">Date</span></p></td><td class="c46" colspan="1" rowspan="1"><p class="c27 c48"><span class="c51 c20">Authors</span></p></td><td class="c25" colspan="1" rowspan="1"><p class="c27 c48"><span class="c51 c20">Comments</span></p></td></tr><tr class="c14"><td class="c64" colspan="1" rowspan="1"><p class="c27 c48"><span class="c38 c5">0.1</span></p></td><td class="c70" colspan="1" rowspan="1"><p class="c27 c48"><span class="c5 c38">15.10.2015</span></p></td><td class="c73" colspan="1" rowspan="1"><p class="c27 c48"><span class="c38 c5">Andrea Petta, Luigi Serra</span></p></td><td class="c72" colspan="1" rowspan="1"><p class="c27 c48"><span class="c38 c5">First version</span></p></td></tr></tbody></table><p class="c1 c7"><span class="c35 c20"></span></p><p class="c1 c32"><span class="c13"><a class="c15" href="#h.couwk1phskca">An architectural overview</a></span></p><p class="c1 c32"><span class="c13"><a class="c15" href="#h.urv1litmuehw">Code control system</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.6d53fxfci78h">Prerequisites</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.3fwzssauigko">Git</a></span></p><p class="c1 c32"><span class="c13"><a class="c15" href="#h.kq0jx6d2gu42">Keywords</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.2xi4iyxti3it">Web Component</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.waf9mw9uy47v">Polymer</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.oylshnr4dqms">webcomponents.js polyfills</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.wtrwkodajjel">Datalet</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.oa5t1t1cc2mn">Datalet lifecycle</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.qor0wy2nd780">Controllet</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.c8d89fu6xb9y">DatalEts Ecosystem Provider (DEEP)</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.juucc2j3piae">DEEPCLIENT</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.k19gs218be3l">DEEPCLIENT Usage:</a></span></p><p class="c1 c32"><span class="c13"><a class="c15" href="#h.pz7vvqc2atb">Components Tutorial (Polymer 1.0)</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.ig6fal8a8s2x">A behaviors based architecture</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.23494m888vls">An example of datalet for Highchart js library</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.qqdl4o86ucxr">Ajax-Json-JsonPath behavior</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.lmehzpjkgz75">Base datalet</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.6otvlqmjxt9s">base-ajax-json-jsonpath-datalet Datalet</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.5kn6d9gehrxp">Highcharts component</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.ns7fynbyet5s">Linechart datalet</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.ve1g902t8v">Barchart datalet</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.l8rhx6bh9kf">Datatable-datalet</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.p6eipyeci0pi">Component documentation</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.hchmkvzcaha3">Deploy a new component</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.biecd569lsp">Datalet directory structure</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.8vkbn4c7d1kb">Deploy</a></span></p><p class="c1 c32"><span class="c13"><a class="c15" href="#h.j1ju11botx5f">MISC</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.lj7afoxzjwpx">Integrated Development Environment: phpStorm</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.dj5v4msbbn4q">Useful Links</a></span></p><h1 class="c28 c1 c30"><a name="h.s3f4husqykcg"></a></h1><hr style="page-break-before:always;display:none;"><h1 class="c28 c1 c30"><a name="h.njs1zyw12f7z"></a></h1><h1 class="c28 c1"><a name="h.couwk1phskca"></a><span class="c59">An architectural overview</span></h1><p class="c1 c7"><span class="c20 c62"></span></p><p class="c1"><span>We&rsquo;ll briefly introduce our Datalet architectural design. </span></p><p class="c1 c7"><span></span></p><p class="c1"><span>We have three actors: </span></p><ul class="c18 lst-kix_oia1ur76tkla-0 start"><li class="c1 c3"><span>client page that exploit DEEP-Client functionality</span></li><li class="c1 c3"><span>DEEP (DatalEts Ecosystem Provider)</span></li><li class="c1 c3"><span>DEEP-Component</span></li></ul><p class="c1 c7"><span></span></p><p class="c1"><span>The DEEP-Client ask to DEEP for a specific Datalet, DEEP responds with the information necessary for the Datalet inclusion, the DEEP-Client retrieve the Datalet from DEEP-Component and include it into the page.</span></p><p class="c1"><span style="overflow: hidden; display: inline-block; margin: 0.00px 0.00px; border: 0.00px solid #000000; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px); width: 624.00px; height: 342.67px;"><img alt="SPOD__1_.png" src="images/image00.png" style="width: 624.00px; height: 342.67px; margin-left: 0.00px; margin-top: 0.00px; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px);" title=""></span></p><ul class="c18 lst-kix_z1db35cwkqzv-0 start"><li class="c1 c3 c31"><span class="c53">A HTML web page that dynamically includes webcomponents must include the </span><span class="c53 c20">DEEPCLIENT </span><span class="c53">Javascript library, configured with the URL of the DEEP repository.</span></li><li class="c1 c3 c31"><span class="c53">In the above image, a web page contains a </span><span class="c53 c20">data-table</span><span class="c53">&nbsp;webcomponent that is configured with a </span><span class="c74 c41">data_url</span><span class="c53">&nbsp;elements (an URL to a data-source) and a </span><span class="c41 c74">params</span><span class="c53">&nbsp;element (that may contain configuration parameters as requested by the webcomponent).</span></li><li class="c1 c3 c31"><span class="c53">DEEPCLIENT contacts DEEP and asks for the location of the data-table webcomponent.</span></li><li class="c1 c3 c31"><span class="c53">DEEP answers with the complete URL where the Client can download the data-table component.</span></li><li class="c1 c3 c31"><span class="c53">DEEPCLIENT sends a request to the aforementioned webcomponent URL and downloads the data-table webcomponent&#39;s code. We say that webcomponents are hosted by a DEEPCOMPONENT repository (basically a web server compatible with HTTP/Ajax that serves webcomponents&#39; HTML code).</span></li><li class="c1 c3 c31"><span class="c53">Once downloaded the data-table webcomponent&#39;s code can be placed in the HTML client page and rendered within the browser.</span></li></ul><p class="c1 c7 c12"><span class="c53"></span></p><h1 class="c28 c1"><a name="h.urv1litmuehw"></a><span class="c59">Code control system</span></h1><h2 class="c28 c1 c58"><a name="h.6d53fxfci78h"></a><span class="c35 c20">Prerequisites</span></h2><p class="c1 c7"><span></span></p><ul class="c18 lst-kix_w0lbiu9bsebc-0 start"><li class="c1 c3"><span>Web server with PHP support (DEEP is currently developed in PHP)</span></li><li class="c1 c3"><span>Git client</span></li></ul><h2 class="c28 c1"><a name="h.3fwzssauigko"></a><span class="c20 c62">Git</span></h2><p class="c1 c7"><span></span></p><p class="c1 c58"><span>Go to </span><span class="c44"><a class="c15" href="https://www.google.com/url?q=http://service.routetopa.eu:7480/users/sign_in&amp;sa=D&amp;usg=AFQjCNGrCFMrZzF4Ao1w1RrmCkv-Dw-s2Q">http://service.routetopa.eu:7480/users/sign_in</a></span><span>&nbsp;and create an account.</span></p><p class="c1 c58"><span>Send an email to GIT system administrator (specifying your email account on GIT) to be added into </span><span class="c20">WebCompDev </span><span>group.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>From terminal:</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>$ git config --global user.name &ldquo;YOUR NAME&rdquo;</span></p><p class="c1"><span>$ git config --global user.mail &ldquo;YOUR EMAIL ADDRESS&rdquo;</span></p><p class="c1"><span>&nbsp;</span></p><p class="c1"><span>Create a directory inside your public HTML web server directory, then :</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>$ git clone http://service.routetopa.eu:7480/isislab/DEEP.git</span></p><p class="c1"><span>$ git clone http://service.routetopa.eu:7480/isislab/DEEPCLIENT.git</span></p><p class="c1"><span>$ git clone http://service.routetopa.eu:7480/WebCompDev/COMPONENTS.git</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>now in your web server&#39;s local directory there are 3 new directory DEEP, DEEPCLIENT, COMPONENTS. </span></p><p class="c1 c7"><span></span></p><p class="c1"><span>Now we have to configure DEEP and DEEPCLIENT to work correctly on your environment.</span></p><p class="c1"><span>In DEEP directory edit file datalets.xml. Substitute the &lt;components_repository_url_reference&gt; value with the full URL of COMPONENTS/datalets just cloned, repeat the same operation for controllets.xml.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>In DEEPCLIENT edit file index.html and substitute ComponentService.deep_url with the correct DEEP URL.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>Now you can test the Datalet demo pointing the browser to DEEPCLIENT/index.html</span></p><p class="c1 c7"><span></span></p><hr style="page-break-before:always;display:none;"><p class="c1 c7"><span></span></p><h1 class="c28 c1"><a name="h.kq0jx6d2gu42"></a><span class="c59">Keywords</span></h1><p class="c1 c7"><span class="c20"></span></p><h2 class="c28 c1"><a name="h.2xi4iyxti3it"></a><span class="c24 c20">Web Component </span></h2><p class="c1"><span>Are a set of standards currently being produced by Google engineers as a W3C specification that allow for the creation of reusable widgets or components in web documents and web applications.<br>Web Components consist of 4 main elements which can be used separately or all together:</span></p><ul class="c18 lst-kix_ucxv06xdi15q-0 start"><li class="c1 c3"><span>Custom Elements</span></li><li class="c1 c3"><span>Shadow DOM</span></li><li class="c1 c3"><span>HTML Imports</span></li><li class="c1 c3"><span>HTML Templates</span></li></ul><h2 class="c28 c1"><a name="h.waf9mw9uy47v"></a><span class="c24 c20">Polymer </span></h2><p class="c1"><span>The Polymer library developed by Google is designed to make easier and faster for developers to create reusable components for the modern web.</span></p><p class="c1 c7"><span></span></p><h2 class="c28 c1"><a name="h.oylshnr4dqms"></a><span class="c24 c20">webcomponents.js polyfills</span></h2><p class="c1"><span>Are a set of polyfills built on top of the Web Components specifications. It makes possible for developers to use these standards today across all modern browsers. As these technologies are implemented in browsers, the polyfills will shrink and you&#39;ll gain the benefits of native implementations. webcomponents.js automatically detects native support and switches to the fast path when available. Your elements seamlessly start relying on the native implementation.</span></p><p class="c1 c7"><span class="c20"></span></p><h2 class="c28 c1"><a name="h.wtrwkodajjel"></a><span class="c24 c20">Datalet</span></h2><p class="c1"><span>It&lsquo;s responsible for data retrieving, filtering and visualization. From technological point of view it&rsquo;s a web component built with </span><span class="c16">polymer library</span><span>. In our architecture each Datalet inherit from a base web component: base-datalet. </span></p><p class="c1"><span>The base-datalet have two main attributes: data_url and query. The data_url attribute specify the data url from which to take data. This data should be json formatted and available by ajax request. The query attribute is a string which represent a selection and, optionally, filtering to apply to retrieved data. </span></p><p class="c1 c7"><span></span></p><h3 class="c19 c1 c10"><a name="h.oa5t1t1cc2mn"></a><span class="c26 c20">Datalet lifecycle</span></h3><p class="c1 c10 c7"><span class="c20"></span></p><p class="c1 c10"><span>Each Datalet follow this lifecycle inherit from base-datalet:</span></p><p class="c1 c10 c7"><span></span></p><ol class="c18 lst-kix_cktmoc41t532-0 start" start="1"><li class="c1 c11"><span>Data retrieving through an ajax request</span></li><li class="c1 c11"><span>Data selection </span></li><li class="c1 c11"><span>Data filtering (optional)</span></li><li class="c1 c11"><span>Data transformation </span></li><li class="c1 c11"><span>Data presentation</span></li></ol><p class="c1 c7"><span></span></p><p class="c1 c7"><span></span></p><p class="c1 c7"><span></span></p><p class="c1 c7"><span class="c20"></span></p><p class="c1 c7"><span class="c20"></span></p><h2 class="c28 c1"><a name="h.qor0wy2nd780"></a><span class="c20 c24">Controllet </span></h2><p class="c1"><span>It&rsquo;s a web component created with Polymer library that implements control behaviour like form, slider, etc. It generally use a set of polymer core elements to realize a more complex component using composition paradigm.</span></p><p class="c1 c7"><span class="c20"></span></p><h2 class="c28 c1"><a name="h.c8d89fu6xb9y"></a><span class="c24 c20">DatalEts Ecosystem Provider (DEEP)</span></h2><p class="c1"><span>The DatalEts Ecosystem Provider (DEEP) is a RESTful web service written in PHP. It make available a public discovery service that retrieve all the Datalet available into the system and a service call that provide a specific Datalet.</span></p><p class="c1 c7"><span></span></p><h2 class="c28 c1"><a name="h.juucc2j3piae"></a><span class="c24 c20">DEEPCLIENT</span></h2><p class="c1"><span>Is a simple javascript library that allows the connection with DEEP and the inclusion of a Datalet/Controllet within a HTML page.</span></p><p class="c1 c7"><span></span></p><h3 class="c19 c1"><a name="h.k19gs218be3l"></a><span class="c20 c26">DEEPCLIENT Usage: </span></h3><p class="c1 c7"><span></span></p><p class="c1"><span>This is a minimal example of deep client usage. </span></p><p class="c1 c7"><span class="c56 c20 c16"></span></p><p class="c1"><span class="c2 c8">&lt;html&gt;</span><span class="c2 c5"><br></span><span class="c2 c8">&lt;head&gt;</span></p><p class="c1"><span class="c2 c8">&lt;script</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">type</span><span class="c2 c4">=</span><span class="c2 c17">&quot;text/javascript&quot;</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">src</span><span class="c2 c4">=</span><span class="c2 c17">&quot;js/jquery-1.11.2.min.js&quot;</span><span class="c2 c8">&gt;&lt;/script&gt;</span><span class="c2 c5"><br></span><span class="c2 c8">&lt;script</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">type</span><span class="c2 c4">=</span><span class="c2 c17">&quot;text/javascript&quot;</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">src</span><span class="c2 c4">=</span><span class="c2 c17">&quot;js/webcomponents.js&quot;</span><span class="c2 c8">&gt;&lt;/script&gt;</span><span class="c2 c5"><br></span><span class="c2 c8">&lt;script</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">type</span><span class="c2 c4">=</span><span class="c2 c17">&quot;text/javascript&quot;</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">src</span><span class="c2 c4">=</span><span class="c2 c17">&quot;js/deepClient.js&quot;</span><span class="c2 c8">&gt;&lt;/script&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp;</span><span class="c2 c8">&lt;script</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">type</span><span class="c2 c4">=</span><span class="c2 c17">&quot;text/javascript&quot;</span><span class="c2 c8">&gt;</span><span class="c2 c5"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;jQuery(document).ready(function($) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; var datalet_params =</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">{</span><span class="c2 c5"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;component &nbsp; </span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;DATALET_NAME&quot;</span><span class="c2 c4">, </span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; </span><span class="c2 c8">params</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">{</span><span class="c2 c5"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data</span><span class="c2 c4">-</span><span class="c2 c5">url &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;DATA_URL&quot;,</span></p><p class="c1 c10 c50"><span class="c2 c5">layou</span><span class="c2 c4">-</span><span class="c2 c5">param</span><span class="c2 c4">-</span><span class="c0">1</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;LAYOUT-VALUE&quot;,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; </span><span class="c2 c4">}</span><span class="c2 c5"><br> &nbsp; &nbsp; fields &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Array</span><span class="c2 c4">(</span><span class="c2 c17">&quot;FIELD1&quot;</span><span class="c2 c4">,</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;FIELD2&quot;</span><span class="c2 c4">),</span><span class="c2 c5"><br> &nbsp; &nbsp; placeHolder </span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;HTML_PLACEHOLDER&quot;</span></p><p class="c1"><span class="c2 c4">};</span></p><p class="c1"><span class="c2 c5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</span><span class="c2 c6">ComponentService</span><span class="c2 c4">.</span><span class="c2 c5">deep_url </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;DEEP_URL&#39;</span><span class="c2 c4">;</span><span class="c2 c5"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; </span><span class="c2 c6">ComponentService</span><span class="c2 c4">.</span><span class="c2 c5">getComponent</span><span class="c2 c4">(</span><span class="c2 c5">datalet_params</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2 c5"><br> &nbsp; &nbsp;</span><span class="c2 c4">});</span></p><p class="c1"><span class="c2 c5"><br> &nbsp;</span><span class="c2 c8">&lt;/script&gt;</span></p><p class="c1"><span class="c2 c8">&lt;/head&gt;</span></p><p class="c1"><span class="c2 c8">&lt;body&gt;</span></p><p class="c1"><span class="c2 c8">&lt;div</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">id</span><span class="c2 c4">=</span><span class="c2 c17">&quot;HTML_PLACEHOLDER&quot;</span><span class="c2 c8">&gt;&lt;/div&gt;</span></p><p class="c1"><span class="c2 c8">&lt;/body&gt;</span></p><p class="c1"><span class="c2 c8">&lt;/html&gt;</span></p><p class="c1 c7"><span class="c56 c16"></span></p><p class="c1 c7"><span></span></p><p class="c1"><span>We create an empty HTML document with a single DIV. On document ready event we create a datalet_params object, this object contains information for Datalet retrieving and initialization.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>datalet_params contains :</span></p><ul class="c18 lst-kix_iy595p3cktj3-0 start"><li class="c1 c3"><span class="c16">component :</span><span>&nbsp;the Datalet name to be sent to DEEP (Eg. </span><span class="c55">datatable-datalet</span><span>)</span></li><li class="c1 c3"><span class="c16">params.data-url (optional) :</span><span>&nbsp;the datasource URL (Eg.</span><span class="c43"><a class="c15" href="https://www.google.com/url?q=http://demo.ckan.org/api/action/datastore_search?resource_id%3D8324a4c9-66d6-47bf-a898-94237cc39b9f%26limit%3D50&amp;sa=D&amp;usg=AFQjCNGkCQWc7y9Rs22UreQdnCtpPZYVFw">http://demo.ckan.org/api/action/datastore_search?resource_id=8324a4c9-66d6-47bf-a898-94237cc39b9f&amp;limit=50</a></span><span>)</span></li><li class="c1 c3"><span class="c16">params.layout-params (optional)</span><span>: e.g. chart title, axis labels </span></li><li class="c1 c3"><span class="c16">fields :</span><span>&nbsp;an array with user selected fields from datasource (Eg. </span><span class="c69">Array</span><span class="c42">(</span><span class="c55">&quot;Supplier&quot;</span><span class="c42">, </span><span class="c55">&quot;Amount&quot;</span><span class="c42">)</span><span>)</span></li><li class="c1 c3"><span class="c16">placeHolder :</span><span>&nbsp;the ID of the DOM element where place the Datalet </span></li></ul><p class="c1 c7"><span></span></p><p class="c1"><span class="c42 c16">ComponentService.getComponent </span><span>function</span><span class="c42 c16">&nbsp;</span><span>take a datalet_params object as parameter. This function is responsible for Datalet info retrieving from DEPP and Datalet/Controllet code retrieving from DEEPCOMPONENTS. Once the Datalet/Controllet code is available DEEPCLIENT add the Datalet to the document DOM and initialize the Datalet with the </span><span class="c16">params </span><span>parameters. The Datalet/Controllet will use the fields data for the selection step.</span></p><p class="c1"><span>Now the Datalet is able to complete its lifecycle.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>The programmer must specify the DEEP endpoint through the variable </span><span class="c42 c16">ComponentService.deep_url.</span><span><br></span><span>e.g.: ComponentService.deep_url = &#39;http://deep.routetopa.eu/DEEP/&#39;;</span></p><hr style="page-break-before:always;display:none;"><p class="c1 c7"><span></span></p><h1 class="c28 c1"><a name="h.pz7vvqc2atb"></a><span class="c59">Components Tutorial (Polymer 1.0)</span></h1><p class="c1"><span class="c20">[Knowledge required : javascript, html, Polymer 1.0]</span></p><p class="c1 c7"><span></span></p><h2 class="c28 c1"><a name="h.ig6fal8a8s2x"></a><span class="c24 c20">A behaviors based architecture </span></h2><p class="c1 c7"><span></span></p><p class="c1"><span>Since Polymer 1.0 doesn&rsquo;t support components inheritance, we provide a way to have it in datalets, waiting for it in the next Polymer version.</span></p><p class="c1"><span>We provide a bundle of objects that implements all behaviors we want our datalets have. They are divided in two categories : BaseDataletsBehaviors and CustomDataletBehaviors. </span></p><p class="c1"><span>The BaseDataletBehaviors define the lifecycle for all Datalets. Every lifecycle step in BaseDataletBehaviors &nbsp;is implemented in the CustomDataletBehaviors. This mechanism provides a components hierarchy that standardize Datalet production and make reusable common behaviors.</span></p><p class="c1"><span>&nbsp;</span></p><p class="c1"><span>The BaseDataletBehaviors are:</span></p><ul class="c18 lst-kix_caqenjpjbamt-0 start"><li class="c1 c3"><span>BaseDataletBehavior</span></li><li class="c1 c3"><span>WorkcycleBehavior</span></li></ul><p class="c1 c7"><span></span></p><p class="c1"><span>The BaseDataletBehavior define the mandatory attributes that all datalet must have :</span></p><p class="c1 c7"><span></span></p><ul class="c18 lst-kix_mwbvd56bd501-0 start"><li class="c1 c3"><span class="c16">data_url (string) : </span><span>the URL used to get the data from the Open Data Provider (e.g. the CKAN API).</span></li><li class="c1 c3"><span class="c16">fields (String)</span><span>: it represents a JSON array of user selected dataset fields.</span></li><li class="c1 c3"><span class="c16">data (array): </span><span>&nbsp;data structure that store the data retrieved from Open Data Provider.</span></li></ul><p class="c1 c7"><span></span></p><p class="c1"><span class="c2 c8">var</span><span class="c2">&nbsp;</span><span class="c2 c6">BaseDataletBehavior</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;{</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;properties</span><span class="c2 c4">:</span><span class="c2">&nbsp;{</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">It</span><span class="c2">&nbsp;represent the data url </span><span class="c2 c8">from</span><span class="c2">&nbsp;CKAN api</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@attribute</span><span class="c2">&nbsp;dataUrl</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@type</span><span class="c2">&nbsp;</span><span class="c2 c8">string</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@default</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;null&#39;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;dataUrl</span><span class="c2 c4">:</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c6">String,</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c17">&quot;&quot;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">It</span><span class="c2">&nbsp;represents one </span><span class="c2 c8">or</span><span class="c2">&nbsp;multiple fields selected </span><span class="c2 c8">by</span><span class="c2">&nbsp;user</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@attribute</span><span class="c2">&nbsp;fields</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@type</span><span class="c2">&nbsp;</span><span class="c2 c6">String</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@default</span><span class="c2">&nbsp;empty</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;fields</span><span class="c2 c4">:</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c6">String,</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c17">&quot;&quot;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">The</span><span class="c2">&nbsp;selected </span><span class="c2 c8">and</span><span class="c2">&nbsp;transformed data you can </span><span class="c2 c8">use</span><span class="c2">&nbsp;</span><span class="c2 c8">in</span><span class="c2">&nbsp;presentation phase</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@attribute</span><span class="c2">&nbsp;data</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@type</span><span class="c2">&nbsp;</span><span class="c2 c6">Array</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@default</span><span class="c2">&nbsp;empty</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;data</span><span class="c2 c4">:</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c6">Array,</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c4">[]</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;factoryImpl</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(</span><span class="c2">data_url</span><span class="c2 c4">,</span><span class="c2">&nbsp;fields</span><span class="c2 c4">)</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data_url </span><span class="c2 c4">=</span><span class="c2">&nbsp;data_url;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">fields &nbsp; </span><span class="c2 c4">=</span><span class="c2">&nbsp;fields;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;}</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2 c4">};</span></p><p class="c1 c7"><span class="c22 c20"></span></p><p class="c1 c7"><span></span></p><p class="c1 c7"><span></span></p><p class="c1"><span>The WorkcycleBehavior implements the workcycle of each datalets, composed by this steps :</span></p><p class="c1 c7"><span></span></p><ul class="c18 lst-kix_oldlfkxmjbuj-0 start"><li class="c1 c3"><span class="c16">Get the data</span><span>&nbsp;</span><span class="c16">from a source</span><span>&nbsp;: It&rsquo;s responsible for data retrieving from an Open Data Platform. It&rsquo;s the starting point of Datalet work-cycle.</span></li><li class="c1 c3"><span class="c16">Select a subset of fields from the data</span><span>&nbsp;: this operation is data format dependent. It&rsquo;s responsible for extract a query related subset of information from the entire dataset. An multidimensional array will be made available for the transformation step.</span></li><li class="c1 c3"><span class="c16">Filter </span><span>the data by applying logical operation( &lt;, &gt;, =, &lt;=, &gt;=, etc.): this function is designed to apply logical operation to the data created in the selection step (this step and the previous one could be merged together).</span></li><li class="c1 c3"><span class="c16">Transform </span><span>data in order to obtain a coherent data rapresentation</span></li><li class="c1 c3"><span class="c16">Present data </span><span>the data for a specific visualization : here we create the data structure necessary for visualization libraries initialization. At this point could be an interaction with component&rsquo;s DOM. &nbsp; &nbsp; </span></li></ul><p class="c1 c7"><span></span></p><p class="c1"><span class="c2 c8">var</span><span class="c2">&nbsp;</span><span class="c2 c6">WorkcycleBehavior</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;{</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;_component</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">null,</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">Request</span><span class="c2">&nbsp;data </span><span class="c2 c8">from</span><span class="c2">&nbsp;source</span><span class="c2 c4">(</span><span class="c2">e</span><span class="c2 c4">.</span><span class="c2">g</span><span class="c2 c4">.</span><span class="c2">&nbsp;CKAN </span><span class="c2 c8">by</span><span class="c2">&nbsp;api</span><span class="c2 c4">)</span><span class="c2">&nbsp;</span><span class="c2 c8">using</span><span class="c2">&nbsp;some kind of technology</span><span class="c2 c4">(</span><span class="c2">e</span><span class="c2 c4">.</span><span class="c2">g</span><span class="c2 c4">.</span><span class="c2">&nbsp;</span><span class="c2 c6">Ajax)</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;requestData</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;requestData</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">Select</span><span class="c2">&nbsp;the fields </span><span class="c2 c8">from</span><span class="c2">&nbsp;data</span><span class="c2 c4">(</span><span class="c2">typically json</span><span class="c2 c4">)</span><span class="c2">&nbsp;previously retrieved </span><span class="c2 c8">by</span><span class="c2">&nbsp;ajax request</span><span class="c2 c4">.</span><span class="c2">&nbsp;</span><span class="c2 c6">The</span><span class="c2">&nbsp;selection could be </span><span class="c2 c8">done</span><span class="c2">&nbsp;</span><span class="c2 c8">by</span><span class="c2">&nbsp;jsonPath but</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;it depends on the representation data format</span><span class="c2 c4">(</span><span class="c2">CKAN apies </span><span class="c2 c8">return</span><span class="c2">&nbsp;a json representation of the dataset</span><span class="c2 c4">).</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;selectData</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;selectData</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">Filter</span><span class="c2">&nbsp;data previously selected</span><span class="c2 c4">.</span><span class="c2">&nbsp;</span><span class="c2 c6">An</span><span class="c2">&nbsp;example of filterting could be an expression such </span><span class="c2 c17">&quot;fields &gt; 30&quot;</span><span class="c2">&nbsp;</span><span class="c2 c8">or</span><span class="c2">&nbsp;</span><span class="c2 c17">&quot;fields = &#39;AAA&#39;&quot;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">If</span><span class="c2">&nbsp;you are </span><span class="c2 c8">using</span><span class="c2">&nbsp;jsonPath to </span><span class="c2 c8">select</span><span class="c2">&nbsp;the datas you can apply an expression directly </span><span class="c2 c8">in</span><span class="c2">&nbsp;the jsonPath query </span><span class="c2 c8">string.</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;filterData</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;filterData</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">Transform</span><span class="c2">&nbsp;the selected data </span><span class="c2 c8">in</span><span class="c2">&nbsp;order to build the structure that the presentation phase needs.</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;transformData</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;transformData</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">Build</span><span class="c2">&nbsp;the </span><span class="c2 c8">object</span><span class="c2 c4">/</span><span class="c2">s </span><span class="c2 c8">for</span><span class="c2">&nbsp;presentation layer.</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;presentData</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;presentData</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">This</span><span class="c2">&nbsp;method represents the entire datalet workcycle.</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;runWorkcycle</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;runWorkcycle</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">()</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">selectData</span><span class="c2 c4">();</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">filterData</span><span class="c2 c4">();</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">transformData</span><span class="c2 c4">();</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">presentData</span><span class="c2 c4">();</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">This</span><span class="c2">&nbsp;method save the reference to the polymer </span><span class="c2 c8">object</span><span class="c2">&nbsp;related to the datalet.</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;init</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;init</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(</span><span class="c2">component</span><span class="c2 c4">){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">_component </span><span class="c2 c4">=</span><span class="c2">&nbsp;component;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">requestData</span><span class="c2 c4">();</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;}</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2 c4">};</span></p><p class="c1 c7"><span class="c20 c22"></span></p><p class="c1"><span>&nbsp;</span></p><p class="c1"><span>The </span><span class="c16">CustomDataletBehaviors </span><span>represents the specific implementation for the work-cycle steps. </span></p><p class="c1"><span>This behaviours are a components hierarchy that use a particular communication channel, data format and visualization library.</span></p><h2 class="c28 c1"><a name="h.23494m888vls"></a><span class="c24 c20">An example of datalet for Highchart js library</span></h2><p class="c1 c7"><span></span></p><p class="c1"><span>We&rsquo;ll describe for example purpose a Datalet that use a AJAX channal, handle JSON data format and use Highcharts for data visualization and JSONPATH library for data selection.</span></p><p class="c1 c7"><span></span></p><h3 class="c1 c19"><a name="h.qqdl4o86ucxr"></a><span class="c26 c20">Ajax-Json-JsonPath behavior</span></h3><p class="c1 c7"><span></span></p><p class="c1"><span>Here we exploit an AJAX communication channel that handle JSON data format and extends the base behaviors (in particular the requestData method). This behavior override the </span><span class="c16">select </span><span>method in order to perform a JSONPATH query according to the user selected fields stored in the </span><span class="c16">this._component.fields </span><span>variable.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span class="c2 c8">var</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">AjaxJsonJsonPathBehavior</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;{</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;properties</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">It</span><span class="c2 c5">&nbsp;contains the json data </span><span class="c2 c8">from</span><span class="c2 c5">&nbsp;async xhr call returned </span><span class="c2 c8">from</span><span class="c2 c5">&nbsp;core</span><span class="c2 c4">-</span><span class="c2 c5">ajax core component</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@attribute</span><span class="c2 c5">&nbsp;json_results</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@type</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">object</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@default</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;null&#39;.</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;json_results</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Object,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">{}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Make</span><span class="c2 c5">&nbsp;an AJAX call to the dataset URL</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@method</span><span class="c2 c5">&nbsp;requestData</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;requestData</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;comp </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this;</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;$</span><span class="c2 c4">.</span><span class="c2 c5">ajax</span><span class="c2 c4">({</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;url</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">dataUrl,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dataType</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;json&quot;,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;success</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(</span><span class="c2 c5">e</span><span class="c2 c4">){</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;comp</span><span class="c2 c4">.</span><span class="c2 c5">handleResponse</span><span class="c2 c4">(</span><span class="c2 c5">e</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">});</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Called</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">when</span><span class="c2 c5">&nbsp;core</span><span class="c2 c4">-</span><span class="c2 c5">ajax component receive the json data </span><span class="c2 c8">from</span><span class="c2 c5">&nbsp;called url.</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@method</span><span class="c2 c5">&nbsp;handleResponse</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;handleResponse</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(</span><span class="c2 c5">e</span><span class="c2 c4">)</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">properties</span><span class="c2 c4">.</span><span class="c2 c5">json_results</span><span class="c2 c4">.</span><span class="c2 c5">value </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;e;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">runWorkcycle</span><span class="c2 c4">();</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Check</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">if</span><span class="c2 c5">&nbsp;input field</span><span class="c2 c4">(</span><span class="c2 c5">passed </span><span class="c2 c8">as</span><span class="c2 c5">&nbsp;an array of separated value that mach </span><span class="c2 c8">with</span><span class="c2 c5">&nbsp;field path </span><span class="c2 c8">in</span><span class="c2 c5">&nbsp;received </span><span class="c2 c8">object</span><span class="c2 c4">)</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">is</span><span class="c2 c5">&nbsp;an array of objet.</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">The</span><span class="c2 c5">&nbsp;field </span><span class="c2 c8">is</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">checked</span><span class="c2 c5">&nbsp;on current json </span><span class="c2 c8">object</span><span class="c2 c5">&nbsp;retrieved </span><span class="c2 c8">from</span><span class="c2 c5">&nbsp;the async request.</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@param</span><span class="c2 c5">&nbsp;field</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;isFieldArray </span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(</span><span class="c2 c5">field</span><span class="c2 c4">){</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; </span><span class="c2 c8">if</span><span class="c2 c4">(</span><span class="c2 c5">field</span><span class="c2 c4">.</span><span class="c2 c5">length </span><span class="c2 c4">==</span><span class="c2 c5">&nbsp;</span><span class="c0">0</span><span class="c2 c4">)</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">return</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">false;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; </span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;obj </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">properties</span><span class="c2 c4">.</span><span class="c2 c5">json_results</span><span class="c2 c4">.</span><span class="c2 c5">value</span><span class="c2 c4">[</span><span class="c2 c5">field</span><span class="c2 c4">[</span><span class="c0">0</span><span class="c2 c4">]];</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; </span><span class="c2 c8">for</span><span class="c2 c4">(</span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;i</span><span class="c2 c4">=</span><span class="c0">1</span><span class="c2 c4">;</span><span class="c2 c5">&nbsp;i </span><span class="c2 c4">&lt;</span><span class="c2 c5">&nbsp;field</span><span class="c2 c4">.</span><span class="c2 c5">length</span><span class="c2 c4">;</span><span class="c2 c5">&nbsp;i</span><span class="c2 c4">++){</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;obj </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">(</span><span class="c2 c5">obj</span><span class="c2 c4">.</span><span class="c2 c5">constructor </span><span class="c2 c4">==</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Array</span><span class="c2 c4">)</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">?</span><span class="c2 c5">&nbsp;obj</span><span class="c2 c4">[</span><span class="c0">0</span><span class="c2 c4">][</span><span class="c2 c5">field</span><span class="c2 c4">[</span><span class="c2 c5">i</span><span class="c2 c4">]]</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;obj</span><span class="c2 c4">[</span><span class="c2 c5">field</span><span class="c2 c4">[</span><span class="c2 c5">i</span><span class="c2 c4">]];</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; }</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; </span><span class="c2 c8">return</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">(</span><span class="c2 c5">obj</span><span class="c2 c4">.</span><span class="c2 c5">constructor </span><span class="c2 c4">===</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Array</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">&amp;&amp;</span><span class="c2 c5">&nbsp;obj</span><span class="c2 c4">[</span><span class="c0">0</span><span class="c2 c4">].</span><span class="c2 c5">constructor </span><span class="c2 c4">==</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Object</span><span class="c2 c4">)</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">?</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">true</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">false;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;selectData built a JSONPATH query based on the user selected fields </span><span class="c2 c8">then</span><span class="c2 c5">&nbsp;extract data </span><span class="c2 c8">from</span><span class="c2 c5">&nbsp;the JSON response.</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">This</span><span class="c2 c5">&nbsp;method built an objects </span><span class="c2 c4">&lt;</span><span class="c2 c5">name</span><span class="c2 c4">,</span><span class="c2 c5">&nbsp;data</span><span class="c2 c4">&gt;</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">for</span><span class="c2 c5">&nbsp;every user selected field </span><span class="c2 c8">and</span><span class="c2 c5">&nbsp;push it </span><span class="c2 c8">into</span><span class="c2 c5">&nbsp;the data array.</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@method</span><span class="c2 c5">&nbsp;selectData</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;selectData </span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">data </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">[];</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">fields </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;JSON</span><span class="c2 c4">.</span><span class="c2 c5">parse</span><span class="c2 c4">(</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">fields</span><span class="c2 c4">);</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">for</span><span class="c2 c4">(</span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;i</span><span class="c2 c4">=</span><span class="c0">0</span><span class="c2 c4">;</span><span class="c2 c5">i </span><span class="c2 c4">&lt;</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">fields</span><span class="c2 c4">.</span><span class="c2 c5">length</span><span class="c2 c4">;</span><span class="c2 c5">&nbsp;i</span><span class="c2 c4">++){</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;query </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;$&quot;;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;query_elements </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">fields</span><span class="c2 c4">[</span><span class="c2 c5">i</span><span class="c2 c4">].</span><span class="c2 c5">split</span><span class="c2 c4">(</span><span class="c2 c17">&#39;,&#39;</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">for</span><span class="c2 c4">(</span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;j</span><span class="c2 c4">=</span><span class="c0">0</span><span class="c2 c4">;</span><span class="c2 c5">&nbsp;j </span><span class="c2 c4">&lt;</span><span class="c2 c5">&nbsp;query_elements</span><span class="c2 c4">.</span><span class="c2 c5">length</span><span class="c2 c4">;</span><span class="c2 c5">j</span><span class="c2 c4">++){</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;query </span><span class="c2 c4">+=</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;[&#39;&quot;</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">+</span><span class="c2 c5">&nbsp;query_elements</span><span class="c2 c4">[</span><span class="c2 c5">j</span><span class="c2 c4">]</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">+</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;&#39;]&quot;;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">if</span><span class="c2 c4">(</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">isFieldArray</span><span class="c2 c4">(</span><span class="c2 c5">query_elements</span><span class="c2 c4">.</span><span class="c2 c5">slice</span><span class="c2 c4">(</span><span class="c0">0</span><span class="c2 c4">,</span><span class="c2 c5">j</span><span class="c2 c4">+</span><span class="c0">1</span><span class="c2 c4">))){</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;query </span><span class="c2 c4">+=</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;[*]&quot;;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">data</span><span class="c2 c4">.</span><span class="c2 c5">push</span><span class="c2 c4">({</span><span class="c2 c5">name </span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;query_elements</span><span class="c2 c4">[</span><span class="c2 c5">query_elements</span><span class="c2 c4">.</span><span class="c2 c5">length </span><span class="c2 c4">-</span><span class="c2 c5">&nbsp;</span><span class="c0">1</span><span class="c2 c4">],</span><span class="c2 c5">&nbsp;data </span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;jsonPath</span><span class="c2 c4">(</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">properties</span><span class="c2 c4">.</span><span class="c2 c5">json_results</span><span class="c2 c4">.</span><span class="c2 c5">value</span><span class="c2 c4">,</span><span class="c2 c5">&nbsp;query</span><span class="c2 c4">)});</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;}</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c4">};</span></p><p class="c1 c7"><span class="c2 c8"></span></p><p class="c1 c7"><span></span></p><ul class="c18 lst-kix_mwbvd56bd501-0"><li class="c1 c3"><span class="c16">json_results(object): </span><span>the object that will store the JSON results returned from data request. It will be used from the Datalets which will use this behavior in order to access to this response object everywhere. </span></li><li class="c1 c3"><span class="c16">requestData</span><span>: it&rsquo;s an override of WorkcicleBehavior component to use AJAX to request data</span></li><li class="c1 c3"><span class="c16">handleResponse</span><span>: it&rsquo;s callback for AJAX request that set the </span><span class="c16">json_response </span><span>attribute that will be used by the specialized behavior that will use the data (select, filter and transform) and </span><span class="c16 c66">run the workcycle</span><span>.</span></li></ul><p class="c1 c7"><span></span></p><h3 class="c19 c1"><a name="h.lmehzpjkgz75"></a><span class="c26 c20">Base datalet</span></h3><p class="c1 c7"><span></span></p><p class="c1"><span>We define a </span><span class="c16">base-datalet</span><span>&nbsp;that include BaseDataletBehavior</span><span class="c2">&nbsp;</span><span>and a footer that contain a ROUTE-TO-PA logo and data source domain information.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span class="c2 c8">&lt;link</span><span class="c2">&nbsp;</span><span class="c2 c6">rel</span><span class="c2 c4">=</span><span class="c2 c17">&quot;import&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">href</span><span class="c2 c4">=</span><span class="c2 c17">&quot;../../bower_components/polymer/polymer.html&quot;&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2 c8">&lt;dom-module</span><span class="c2">&nbsp;</span><span class="c2 c6">id</span><span class="c2 c4">=</span><span class="c2 c17">&quot;base-datalet&quot;&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;template&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;style&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">#footer {</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;position</span><span class="c2 c4">:</span><span class="c2">&nbsp;relative;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bottom</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c0">0;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;width</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c0">100</span><span class="c2 c4">%;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;font</span><span class="c2 c4">-</span><span class="c2">size</span><span class="c2 c4">:</span><span class="c2">&nbsp;small;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">#rtpalogo{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;height</span><span class="c2 c4">:</span><span class="c0">30px;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;width</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c0">30px;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;/style&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;b&gt;</span><span class="c2">Source : </span><span class="c2 c8">&lt;/b&gt;&lt;span</span><span class="c2">&nbsp;</span><span class="c2 c6">id</span><span class="c2 c4">=</span><span class="c2 c17">&quot;domain&quot;</span><span class="c2 c8">&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;div</span><span class="c2">&nbsp;</span><span class="c2 c6">id</span><span class="c2 c4">=</span><span class="c2 c17">&quot;footer&quot;</span><span class="c2 c8">&gt;</span><span class="c2">Powered by Route-to-PA&amp;nbsp&amp;nbsp</span><span class="c2 c8">&lt;a</span><span class="c2">&nbsp;</span><span class="c2 c6">href</span><span class="c2 c4">=</span><span class="c2 c17">&quot;http://routetopa.eu/&quot;</span><span class="c2 c8">&gt;&lt;img</span><span class="c2">&nbsp;</span><span class="c2 c6">src</span><span class="c2 c4">=</span><span class="c2 c17">&quot;static/images/rtpalogo.png&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">id</span><span class="c2 c4">=</span><span class="c2 c17">&quot;rtpalogo&quot;</span><span class="c2 c8">&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;/template&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;script</span><span class="c2">&nbsp;</span><span class="c2 c6">src</span><span class="c2 c4">=</span><span class="c2 c17">&quot;static/js/BaseDataletBehaviors.js&quot;</span><span class="c2 c8">&gt;&lt;/script&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;script&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c6">BaseDatalet</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;</span><span class="c2 c6">Polymer</span><span class="c2 c4">({</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">is</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;base-datalet&#39;,</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">It</span><span class="c2">&nbsp;</span><span class="c2 c8">is</span><span class="c2">&nbsp;called after the element</span><span class="c2 c4">&#39;</span><span class="c2">s </span><span class="c2 c8">template</span><span class="c2">&nbsp;has been stamped </span><span class="c2 c8">and</span><span class="c2">&nbsp;all elements inside the element</span><span class="c2 c4">&#39;</span><span class="c2">s </span><span class="c2 c8">local</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;DOM have been configured </span><span class="c2 c4">(</span><span class="c2 c8">with</span><span class="c2">&nbsp;values bound </span><span class="c2 c8">from</span><span class="c2">&nbsp;parents</span><span class="c2 c4">,</span><span class="c2">&nbsp;deserialized attributes</span><span class="c2 c4">,</span><span class="c2">&nbsp;</span><span class="c2 c8">or</span><span class="c2">&nbsp;</span><span class="c2 c8">else</span><span class="c2">&nbsp;</span><span class="c2 c8">default</span><span class="c2">&nbsp;values)</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c8">and</span><span class="c2">&nbsp;had their ready method called.</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">Extract</span><span class="c2">&nbsp;the dataset domain </span><span class="c2 c8">from</span><span class="c2">&nbsp;the entire URL </span><span class="c2 c8">and</span><span class="c2">&nbsp;</span><span class="c2 c8">set</span><span class="c2">&nbsp;the text content of the datalet footer.</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;ready</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ready</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">$</span><span class="c2 c4">.</span><span class="c2">domain</span><span class="c2 c4">.</span><span class="c2">textContent </span><span class="c2 c4">=</span><span class="c2">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">dataUrl</span><span class="c2 c4">.</span><span class="c2">split</span><span class="c2 c4">(</span><span class="c2 c17">&quot;/&quot;</span><span class="c2 c4">)[</span><span class="c0">0</span><span class="c2 c4">]</span><span class="c2">&nbsp;</span><span class="c2 c4">+</span><span class="c2">&nbsp;</span><span class="c2 c17">&quot;//&quot;</span><span class="c2">&nbsp;</span><span class="c2 c4">+</span><span class="c2">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">dataUrl</span><span class="c2 c4">.</span><span class="c2">split</span><span class="c2 c4">(</span><span class="c2 c17">&quot;/&quot;</span><span class="c2 c4">)[</span><span class="c0">2</span><span class="c2 c4">];</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">});</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;/script&gt;</span></p><p class="c1"><span class="c2 c8">&lt;/dom-module&gt;</span></p><p class="c1 c7"><span class="c34"></span></p><p class="c1 c7"><span></span></p><p class="c1"><span>All components that import this one will include the BaseDataletBehavior.</span></p><p class="c1 c7"><span></span></p><h3 class="c19 c1"><a name="h.6otvlqmjxt9s"></a><span class="c26 c20">base-ajax-json-jsonpath-datalet Datalet</span></h3><p class="c1 c7"><span></span></p><p class="c1"><span class="c2 c8">&lt;link</span><span class="c2">&nbsp;</span><span class="c2 c6">rel</span><span class="c2 c4">=</span><span class="c2 c17">&quot;import&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">href</span><span class="c2 c4">=</span><span class="c2 c17">&quot;../base-datalet/base-datalet.html&quot;&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2 c8">&lt;dom-module</span><span class="c2">&nbsp;</span><span class="c2 c6">id</span><span class="c2 c4">=</span><span class="c2 c17">&quot;base-ajax-json-jsonpath-datalet&quot;&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;template&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;base-datalet</span><span class="c2">&nbsp;</span><span class="c2 c6">data-url</span><span class="c2 c4">=</span><span class="c2 c17">&quot;{{dataUrl}}&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">fields</span><span class="c2 c4">=</span><span class="c2 c17">&quot;{{fields}}&quot;</span><span class="c2 c8">&gt;&lt;/base-datalet&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;/template&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;script</span><span class="c2">&nbsp;</span><span class="c2 c6">src</span><span class="c2 c4">=</span><span class="c2 c17">&quot;static/js/vendor/jsonpath-0.8.5.js&quot;</span><span class="c2 c8">&gt;&lt;/script&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;script</span><span class="c2">&nbsp;</span><span class="c2 c6">src</span><span class="c2 c4">=</span><span class="c2 c17">&quot;static/js/AjaxJsonJsonPathBehavior.js&quot;</span><span class="c2 c8">&gt;&lt;/script&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;script&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c6">BaseDatalet</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;</span><span class="c2 c6">Polymer</span><span class="c2 c4">({</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">is</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;base-ajax-json-jsonpath-datalet&#39;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">});</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;/script&gt;</span></p><p class="c1"><span class="c2 c8">&lt;/dom-module&gt;</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>All components that import this one will include AjaxJsonJsonPathBehavior and JSONPath library. Since this Datalet handle JSON data, we use JSONPath (</span><span class="c44"><a class="c15" href="https://www.google.com/url?q=http://goessner.net/articles/JsonPath/&amp;sa=D&amp;usg=AFQjCNGOqQI4Dex9zLdrZuBzOrLQrcgPrw">http://goessner.net/articles/JsonPath/</a></span><span>) to select specific fields from entire dataset (an example of query is $.result.records..Supplier $.result.records..Amount). For a new datatype a new behavior and new way to select the fields should be provided.</span></p><h3 class="c19 c1"><a name="h.5kn6d9gehrxp"></a><span class="c26 c20">Highcharts component</span></h3><p class="c1 c7"><span class="c20 c35"></span></p><p class="c1"><span>The component we&rsquo;ll present in this section include Highcharts javascript library (</span><span class="c44"><a class="c15" href="https://www.google.com/url?q=http://www.highcharts.com/&amp;sa=D&amp;usg=AFQjCNGff99OZ7OOqXVqP6dPX0ZQRv8QJw">http://www.highcharts.com/</a></span><span>) to visualize data in a several type of charts.</span></p><p class="c1"><span>Since all selected example charts use the same way to select the data to build the categories and series objects, we built a super Highchart component which all our specific chart datalet will &ldquo;extend&rdquo; in order to share the selection mechanism.</span></p><p class="c1"><span>&nbsp;</span></p><p class="c1"><span class="c2 c8">&lt;link</span><span class="c2">&nbsp;</span><span class="c2 c6">rel</span><span class="c2 c4">=</span><span class="c2 c17">&quot;import&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">href</span><span class="c2 c4">=</span><span class="c2 c17">&quot;../base-ajax-json-jsonpath-datalet/base-ajax-json-jsonpath-datalet.html&quot;&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2 c8">&lt;dom-module</span><span class="c2">&nbsp;</span><span class="c2 c6">id</span><span class="c2 c4">=</span><span class="c2 c17">&quot;highcharts-datalet&quot;&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;template&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;div</span><span class="c2">&nbsp;</span><span class="c2 c6">id</span><span class="c2 c4">=</span><span class="c2 c17">&quot;container&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">style</span><span class="c2 c4">=</span><span class="c2 c17">&quot;</span><span class="c2">width</span><span class="c2 c4">:</span><span class="c2 c8">auto</span><span class="c2 c4">;</span><span class="c2">&nbsp;height</span><span class="c2 c4">:</span><span class="c2 c8">auto</span><span class="c2 c4">;</span><span class="c2 c17">&quot;</span><span class="c2 c8">&gt;&lt;/div&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;base-ajax-json-jsonpath-datalet</span><span class="c2">&nbsp;</span><span class="c2 c6">data-url</span><span class="c2 c4">=</span><span class="c2 c17">&quot;{{dataUrl}}&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">fields</span><span class="c2 c4">=</span><span class="c2 c17">&quot;{{fields}}&quot;</span><span class="c2 c8">&gt;&lt;/base-ajax-json-jsonpath-datalet&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;/template&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;script</span><span class="c2">&nbsp;</span><span class="c2 c6">src</span><span class="c2 c4">=</span><span class="c2 c17">&quot;static/js/highcharts.js&quot;</span><span class="c2 c8">&gt;&lt;/script&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;script</span><span class="c2">&nbsp;</span><span class="c2 c6">src</span><span class="c2 c4">=</span><span class="c2 c17">&quot;static/js/exporting.js&quot;</span><span class="c2 c8">&gt;&lt;/script&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;script&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">var</span><span class="c2">&nbsp;</span><span class="c2 c6">HighchartsBehavior</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;{</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;properties</span><span class="c2 c4">:</span><span class="c2">&nbsp;{</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;categories</span><span class="c2 c4">:</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c6">Array,</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c4">[]</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;series</span><span class="c2 c4">:</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c6">Array,</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c4">[]</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;series_type</span><span class="c2 c4">:{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c6">String,</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c17">&quot;line&quot;</span><span class="c2 c9">//spline,time</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">Populate</span><span class="c2">&nbsp;the categories </span><span class="c2 c8">and</span><span class="c2">&nbsp;the series array.</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;transformData</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@param</span><span class="c2">&nbsp;</span><span class="c2 c4">{</span><span class="c2 c6">Event</span><span class="c2 c4">}</span><span class="c2">&nbsp;e</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;transformData</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2">&nbsp;</span><span class="c2 c4">()</span><span class="c2">&nbsp;{</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">properties</span><span class="c2 c4">.</span><span class="c2">categories</span><span class="c2 c4">.</span><span class="c2">value </span><span class="c2 c4">=</span><span class="c2">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data</span><span class="c2 c4">[</span><span class="c0">0</span><span class="c2 c4">].</span><span class="c2">data;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">for</span><span class="c2">&nbsp;</span><span class="c2 c4">(</span><span class="c2 c8">var</span><span class="c2">&nbsp;i </span><span class="c2 c4">=</span><span class="c2">&nbsp;</span><span class="c0">1</span><span class="c2 c4">;</span><span class="c2">&nbsp;i </span><span class="c2 c4">&lt;</span><span class="c2">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data</span><span class="c2 c4">.</span><span class="c2">length</span><span class="c2 c4">;</span><span class="c2">&nbsp;i</span><span class="c2 c4">++)</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data</span><span class="c2 c4">[</span><span class="c2">i</span><span class="c2 c4">].</span><span class="c2">data</span><span class="c2 c4">.</span><span class="c2">every</span><span class="c2 c4">(</span><span class="c2 c8">function</span><span class="c2">&nbsp;</span><span class="c2 c4">(</span><span class="c2">element</span><span class="c2 c4">,</span><span class="c2">&nbsp;index</span><span class="c2 c4">,</span><span class="c2">&nbsp;array</span><span class="c2 c4">)</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">try</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">// TODO fix this parsing mechanism</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">(</span><span class="c2">isNaN</span><span class="c2 c4">(</span><span class="c2">parseFloat</span><span class="c2 c4">(</span><span class="c2">element</span><span class="c2 c4">)))</span><span class="c2">&nbsp;</span><span class="c2 c4">?</span><span class="c2">&nbsp;array</span><span class="c2 c4">[</span><span class="c2">index</span><span class="c2 c4">]</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;parseFloat</span><span class="c2 c4">(</span><span class="c2">element</span><span class="c2 c4">.</span><span class="c2">match</span><span class="c2 c4">(</span><span class="c2 c17">/[0-9]+/</span><span class="c2">g</span><span class="c2 c4">).</span><span class="c2">join</span><span class="c2 c4">(</span><span class="c2 c17">&quot;.&quot;</span><span class="c2 c4">))</span><span class="c2">&nbsp;:</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;array</span><span class="c2 c4">[</span><span class="c2">index</span><span class="c2 c4">]</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;parseFloat</span><span class="c2 c4">(</span><span class="c2">element</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">}</span><span class="c2 c8">catch</span><span class="c2 c4">(</span><span class="c2">e</span><span class="c2 c4">){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">//console.log(&quot;Parsing data error. Highchart-datalet.selectData&quot;);</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">return</span><span class="c2">&nbsp;</span><span class="c2 c8">true;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">});</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">properties</span><span class="c2 c4">.</span><span class="c2">series</span><span class="c2 c4">.</span><span class="c2">value</span><span class="c2 c4">.</span><span class="c2">push</span><span class="c2 c4">(</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data</span><span class="c2 c4">[</span><span class="c2">i</span><span class="c2 c4">]);</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">};</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">var</span><span class="c2">&nbsp;</span><span class="c2 c6">HighchartsComponentBehavior</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;$</span><span class="c2 c4">.</span><span class="c2">extend</span><span class="c2 c4">(</span><span class="c2 c8">true</span><span class="c2 c4">,</span><span class="c2">&nbsp;</span><span class="c2 c4">{},</span><span class="c2">&nbsp;</span><span class="c2 c6">BaseDataletBehavior</span><span class="c2 c4">,</span><span class="c2">&nbsp;</span><span class="c2 c6">WorkcycleBehavior</span><span class="c2 c4">,</span><span class="c2">&nbsp;</span><span class="c2 c6">AjaxJsonJsonPathBehavior</span><span class="c2 c4">,</span><span class="c2">&nbsp;</span><span class="c2 c6">HighchartsBehavior</span><span class="c2 c4">);</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c6">HighchartsDatalet</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;</span><span class="c2 c6">Polymer</span><span class="c2 c4">({</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">is</span><span class="c2">&nbsp;</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;highcharts-datalet&#39;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">});</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;/script&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2 c8">&lt;/dom-module&gt;</span></p><p class="c1 c7"><span class="c34"></span></p><p class="c1 c7"><span class="c34"></span></p><p class="c1"><span>First we have to import the base-ajax-json-jsonpath-datalet, in order to extend its behavior and include its DOM:</span></p><p class="c1 c7"><span class="c34"></span></p><p class="c1"><span class="c2 c8">&lt;link</span><span class="c2">&nbsp;</span><span class="c2 c6">rel</span><span class="c2 c4">=</span><span class="c2 c17">&quot;import&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">href</span><span class="c2 c4">=</span><span class="c2 c17">&quot;../base-datalet/base-datalet.html&quot;&gt;</span></p><p class="c1 c7"><span class="c67 c63"></span></p><p class="c1 c7"><span class="c67 c63"></span></p><p class="c1"><span>In the template section (the DOM part of our new datalet) we include the superclass DOM (as footer) and create a div as placeholder for chart object. </span></p><p class="c1 c7"><span></span></p><p class="c1"><span class="c2 c8">&lt;template&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;div</span><span class="c2">&nbsp;</span><span class="c2 c6">id</span><span class="c2 c4">=</span><span class="c2 c17">&quot;container&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">style</span><span class="c2 c4">=</span><span class="c2 c17">&quot;</span><span class="c2">width</span><span class="c2 c4">:</span><span class="c2 c8">auto</span><span class="c2 c4">;</span><span class="c2">&nbsp;height</span><span class="c2 c4">:</span><span class="c2 c8">auto</span><span class="c2 c4">;</span><span class="c2 c17">&quot;</span><span class="c2 c8">&gt;&lt;/div&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;base-ajax-json-jsonpath-datalet</span><span class="c2">&nbsp;</span><span class="c2 c6">data-url</span><span class="c2 c4">=</span><span class="c2 c17">&quot;{{dataUrl}}&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">fields</span><span class="c2 c4">=</span><span class="c2 c17">&quot;{{fields}}&quot;</span><span class="c2 c8">&gt;&lt;/base-ajax-json-jsonpath-datalet&gt;</span></p><p class="c1"><span class="c2 c8">&lt;/template&gt;</span></p><p class="c1 c7"><span class="c34"></span></p><p class="c1"><span>&nbsp; &nbsp;</span></p><p class="c1"><span>At this point we include the Highchart javascript library used by all chart datalets which use Highchart as visualization library.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span class="c2 c8">&lt;script</span><span class="c2">&nbsp;</span><span class="c2 c6">src</span><span class="c2 c4">=</span><span class="c2 c17">&quot;static/js/highcharts.js&quot;</span><span class="c2 c8">&gt;&lt;/script&gt;</span></p><p class="c1"><span class="c2 c8">&lt;script</span><span class="c2">&nbsp;</span><span class="c2 c6">src</span><span class="c2 c4">=</span><span class="c2 c17">&quot;static/js/exporting.js&quot;</span><span class="c2 c8">&gt;&lt;/script&gt;</span></p><p class="c1 c7"><span class="c34"></span></p><p class="c1 c7"><span class="c63 c67"></span></p><p class="c1"><span>Now we define a new behavior with all attribute that the specialized chart datalets can share (</span><span class="c16">categories</span><span>&nbsp;and </span><span class="c16">series</span><span>) and the implementation of a selection method. </span></p><p class="c1 c7"><span></span></p><p class="c1"><span class="c2 c8">var</span><span class="c2">&nbsp;</span><span class="c2 c6">HighchartsBehavior</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;{</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;properties</span><span class="c2 c4">:</span><span class="c2">&nbsp;{</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;categories</span><span class="c2 c4">:</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c6">Array,</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c4">[]</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;series</span><span class="c2 c4">:</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c6">Array,</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c4">[]</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;series_type</span><span class="c2 c4">:{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c6">String,</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c17">&quot;line&quot;</span><span class="c2 c9">//spline,time</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">Populate</span><span class="c2">&nbsp;the categories </span><span class="c2 c8">and</span><span class="c2">&nbsp;the series array.</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;transformData</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@param</span><span class="c2">&nbsp;</span><span class="c2 c4">{</span><span class="c2 c6">Event</span><span class="c2 c4">}</span><span class="c2">&nbsp;e</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;transformData</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2">&nbsp;</span><span class="c2 c4">()</span><span class="c2">&nbsp;{</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">properties</span><span class="c2 c4">.</span><span class="c2">categories</span><span class="c2 c4">.</span><span class="c2">value </span><span class="c2 c4">=</span><span class="c2">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data</span><span class="c2 c4">[</span><span class="c0">0</span><span class="c2 c4">].</span><span class="c2">data;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">for</span><span class="c2">&nbsp;</span><span class="c2 c4">(</span><span class="c2 c8">var</span><span class="c2">&nbsp;i </span><span class="c2 c4">=</span><span class="c2">&nbsp;</span><span class="c0">1</span><span class="c2 c4">;</span><span class="c2">&nbsp;i </span><span class="c2 c4">&lt;</span><span class="c2">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data</span><span class="c2 c4">.</span><span class="c2">length</span><span class="c2 c4">;</span><span class="c2">&nbsp;i</span><span class="c2 c4">++)</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;{</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data</span><span class="c2 c4">[</span><span class="c2">i</span><span class="c2 c4">].</span><span class="c2">data</span><span class="c2 c4">.</span><span class="c2">every</span><span class="c2 c4">(</span><span class="c2 c8">function</span><span class="c2">&nbsp;</span><span class="c2 c4">(</span><span class="c2">element</span><span class="c2 c4">,</span><span class="c2">&nbsp;index</span><span class="c2 c4">,</span><span class="c2">&nbsp;array</span><span class="c2 c4">)</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">try</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">// TODO fix this parsing mechanism</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">(</span><span class="c2">isNaN</span><span class="c2 c4">(</span><span class="c2">parseFloat</span><span class="c2 c4">(</span><span class="c2">element</span><span class="c2 c4">)))</span><span class="c2">&nbsp;</span><span class="c2 c4">?</span><span class="c2">&nbsp;array</span><span class="c2 c4">[</span><span class="c2">index</span><span class="c2 c4">]</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;parseFloat</span><span class="c2 c4">(</span><span class="c2">element</span><span class="c2 c4">.</span><span class="c2">match</span><span class="c2 c4">(</span><span class="c2 c17">/[0-9]+/</span><span class="c2">g</span><span class="c2 c4">).</span><span class="c2">join</span><span class="c2 c4">(</span><span class="c2 c17">&quot;.&quot;</span><span class="c2 c4">))</span><span class="c2">&nbsp;:</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;array</span><span class="c2 c4">[</span><span class="c2">index</span><span class="c2 c4">]</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;parseFloat</span><span class="c2 c4">(</span><span class="c2">element</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">}</span><span class="c2 c8">catch</span><span class="c2 c4">(</span><span class="c2">e</span><span class="c2 c4">){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">//console.log(&quot;Parsing data error. Highchart-datalet.selectData&quot;);</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">return</span><span class="c2">&nbsp;</span><span class="c2 c8">true;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">});</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">properties</span><span class="c2 c4">.</span><span class="c2">series</span><span class="c2 c4">.</span><span class="c2">value</span><span class="c2 c4">.</span><span class="c2">push</span><span class="c2 c4">(</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data</span><span class="c2 c4">[</span><span class="c2">i</span><span class="c2 c4">]);</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c4">};</span></p><p class="c1 c7"><span class="c63 c76"></span></p><p class="c1"><span>We are overriding the </span><span class="c16">transformData </span><span>method of </span><span class="c16">WorkcycleBehavior </span><span>so to access to </span><span class="c16">data attribute</span><span>&nbsp;we have to use the reference to the Polymer component (</span><span class="c16">this._component</span><span>). This reference will be set by the final component that implements all workcycle (that visualize the chart in our example), as we will show you later. As you can notice in the </span><span class="c16">transformData </span><span>function we can access to </span><span class="c16">json_results </span><span>attribute defined in the Behavior that implements the communication channel.</span></p><p class="c1"><span>After defined the Behavior for Highchart component we have to extend it to include the BaseDataletBehavior, WorkcycleBehavior, AjaxJsonJsonPathBehavior to crate a new behavior specific for our new Datalet. The order of the extension is crucial (see JQuery $.extend docs). </span></p><p class="c1 c7"><span></span></p><p class="c1"><span class="c2 c8">var</span><span class="c2">&nbsp;</span><span class="c2 c6">HighchartsComponentBehavior</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;$</span><span class="c2 c4">.</span><span class="c2">extend</span><span class="c2 c4">(</span><span class="c2 c8">true</span><span class="c2 c4">,</span><span class="c2">&nbsp;</span><span class="c2 c4">{},</span><span class="c2">&nbsp;</span><span class="c2 c6">BaseDataletBehavior</span><span class="c2 c4">,</span><span class="c2">&nbsp;</span><span class="c2 c6">WorkcycleBehavior</span><span class="c2 c4">,</span><span class="c2">&nbsp;</span><span class="c2 c6">AjaxJsonJsonPathBehavior</span><span class="c2 c4">,</span><span class="c2">&nbsp;</span><span class="c2 c6">HighchartsBehavior</span><span class="c2 c4">);</span></p><p class="c1 c7"><span class="c22"></span></p><p class="c1 c7"><span></span></p><p class="c1"><span>The last thing to do is to create &nbsp;the Polymer javascript object.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span class="c2 c6">HighchartsDatalet</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;</span><span class="c2 c6">Polymer</span><span class="c2 c4">({</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">is</span><span class="c2">&nbsp;</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;highcharts-datalet&#39;</span></p><p class="c1"><span class="c2 c4">});</span></p><p class="c1 c7"><span class="c36"></span></p><p class="c1 c7"><span></span></p><h3 class="c19 c1"><a name="h.ns7fynbyet5s"></a><span class="c26 c20">Linechart datalet</span></h3><p class="c1 c7"><span></span></p><p class="c1"><span>The linechart-datalet will use the highchart-component to visualize a linechart. To do this we override the </span><span class="c16">presentData </span><span>method, in a new behavior(</span><span class="c16">LinechartBehavior</span><span>), &nbsp;in order to use the categories and series attributes, generated by &ldquo;super class&rdquo;, to build the chart.</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2 c8">&lt;link</span><span class="c2">&nbsp;</span><span class="c2 c6">rel</span><span class="c2 c4">=</span><span class="c2 c17">&quot;import&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">href</span><span class="c2 c4">=</span><span class="c2 c17">&quot;../highcharts-datalet/highcharts-datalet.html&quot;&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2 c8">&lt;dom-module</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">id</span><span class="c2 c4">=</span><span class="c2 c17">&quot;linechart-datalet&quot;&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c8">&lt;template&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;highcharts-datalet</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">id</span><span class="c2 c4">=</span><span class="c2 c17">&quot;charts&quot;</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">data-url</span><span class="c2 c4">=</span><span class="c2 c17">&quot;{{dataUrl}}&quot;</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">fields</span><span class="c2 c4">=</span><span class="c2 c17">&quot;{{fields}}&quot;</span><span class="c2 c8">&gt;&lt;/highcharts-datalet&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c8">&lt;/template&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c8">&lt;script&gt;</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">LinechartBehavior</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;{</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Bluid</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Highchart</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">object</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@method</span><span class="c2 c5">&nbsp;presentData</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;presentData</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$</span><span class="c2 c4">(</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">$</span><span class="c2 c4">.</span><span class="c2 c5">charts</span><span class="c2 c4">.</span><span class="c2 c5">$</span><span class="c2 c4">.</span><span class="c2 c5">container</span><span class="c2 c4">).</span><span class="c2 c5">highcharts</span><span class="c2 c4">({</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;title</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;text</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;&quot;</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">+</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">title</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;chart</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;zoomType</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;xy&#39;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xAxis</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;categories</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">properties</span><span class="c2 c4">.</span><span class="c2 c5">categories</span><span class="c2 c4">.</span><span class="c2 c5">value</span><span class="c2 c4">,</span><span class="c2 c9">//this._component.categories,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;title</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;text</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">xAxisLabel</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;yAxis</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;title</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;text</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">yAxisLabel</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;plotLines</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">[{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c0">0,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;width</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c0">1,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;color</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;#808080&#39;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">}]</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tooltip</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;valueSuffix</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39; &#39;</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">+</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">suffix</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;legend</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;layout</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;vertical&#39;,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;align</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;right&#39;,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;verticalAlign</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;top&#39;,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;x</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">-</span><span class="c0">40,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;y</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c0">100,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;floating</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">true,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;borderWidth</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c0">1,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;backgroundColor</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">((</span><span class="c2 c6">Highcharts</span><span class="c2 c4">.</span><span class="c2 c5">theme </span><span class="c2 c4">&amp;&amp;</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Highcharts</span><span class="c2 c4">.</span><span class="c2 c5">theme</span><span class="c2 c4">.</span><span class="c2 c5">legendBackgroundColor</span><span class="c2 c4">)</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">||</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;#FFFFFF&#39;</span><span class="c2 c4">),</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;shadow</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">true</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;credits</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enabled</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">false</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;series</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">properties</span><span class="c2 c4">.</span><span class="c2 c5">series</span><span class="c2 c4">.</span><span class="c2 c5">value</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">});</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">};</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c6">LinechartDatalet</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Polymer</span><span class="c2 c4">({</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">is</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;linechart-datalet&#39;,</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;properties</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">It</span><span class="c2 c17">&#39;s the label for X axis</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@attribute</span><span class="c2 c5">&nbsp;xAxisLabel</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@type</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">String</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@default</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;&#39;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xAxisLabel</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">String,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;&quot;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">It</span><span class="c2 c17">&#39;s the label for Y axis</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@attribute</span><span class="c2 c5">&nbsp;yAxisLabel</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@type</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">String</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@default</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;&#39;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;yAxisLabel</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">String,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;&quot;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">It</span><span class="c2 c17">&#39;s the title of the chart</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@attribute</span><span class="c2 c5">&nbsp;title</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@type</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Strig</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@default</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;&#39;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;title</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">String,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;Heading&quot;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">It</span><span class="c2 c17">&#39;s the values suffix</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@attribute</span><span class="c2 c5">&nbsp;suffix</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@type</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Strig</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@default</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;units&#39;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;suffix </span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type </span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">String,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value </span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;units&quot;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;ready&#39;</span><span class="c2 c5">&nbsp;callback extend the </span><span class="c2 c6">LinechartComponentBehavior</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">with</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">HighchartsComponentBehavior</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">and</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">LinechartBehavior</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">and</span><span class="c2 c5">&nbsp;run the </span><span class="c2 c6">Datalet</span><span class="c2 c5">&nbsp;workcycle.</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@method</span><span class="c2 c5">&nbsp;ready</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ready</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">LinechartComponentBehavior</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;$</span><span class="c2 c4">.</span><span class="c2 c5">extend</span><span class="c2 c4">(</span><span class="c2 c8">true</span><span class="c2 c4">,</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">{},</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">HighchartsComponentBehavior</span><span class="c2 c4">,</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">LinechartBehavior</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c6">LinechartComponentBehavior</span><span class="c2 c4">.</span><span class="c2 c5">init</span><span class="c2 c4">(</span><span class="c2 c8">this</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">});</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c8">&lt;/script&gt;</span></p><p class="c1"><span class="c2 c8">&lt;/dom-module&gt;</span></p><p class="c1 c7"><span class="c2 c8"></span></p><p class="c1"><span>&nbsp;</span></p><p class="c1"><span>After creating the main component behavior (</span><span class="c16">LinechartComponentBehavior</span><span>) &nbsp;extending the </span><span class="c16">HighchartComponentBehavior </span><span>previously created, we have to initialize it by passing the reference to Polymer object associated to linechart-datalet. We do it &nbsp;in the </span><span class="c16">ready </span><span>handler of Polymer object.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span class="c2 c6">LinechartDatalet</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;</span><span class="c2 c6">Polymer</span><span class="c2 c4">({</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">is</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;linechart-datalet&#39;,</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;ready&#39;</span><span class="c2">&nbsp;callback extend the </span><span class="c2 c6">LinechartComponentBehavior</span><span class="c2">&nbsp;</span><span class="c2 c8">with</span><span class="c2">&nbsp;</span><span class="c2 c6">HighchartsComponentBehavior</span><span class="c2">&nbsp;</span><span class="c2 c8">and</span><span class="c2">&nbsp;</span><span class="c2 c6">LinechartBehavior</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c8">and</span><span class="c2">&nbsp;run the </span><span class="c2 c6">Datalet</span><span class="c2">&nbsp;workcycle.</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;ready</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;ready</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">var</span><span class="c2">&nbsp;</span><span class="c2 c6">LinechartComponentBehavior</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;$</span><span class="c2 c4">.</span><span class="c2">extend</span><span class="c2 c4">(</span><span class="c2 c8">true</span><span class="c2 c4">,</span><span class="c2">&nbsp;</span><span class="c2 c4">{},</span><span class="c2">&nbsp;</span><span class="c2 c6">HighchartsComponentBehavior</span><span class="c2 c4">,</span><span class="c2">&nbsp;</span><span class="c2 c6">LinechartBehavior</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c6">LinechartComponentBehavior</span><span class="c2 c4">.</span><span class="c2">init</span><span class="c2 c4">(</span><span class="c2 c8">this</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c4">});</span></p><p class="c1 c7"><span class="c36"></span></p><p class="c1 c7"><span></span></p><p class="c1"><span>The ready handler define a </span><span class="c33">lifecycle callback invoked when all local DOM children of this element have been created and &quot;configured&quot; with data bound from this element, attribute values, or defaults.</span></p><p class="c1"><span class="c33">The base behavior will use this reference to get information from the Polymer component like passed attributes, DOM, etc.</span></p><p class="c1"><span class="c33">&nbsp;</span></p><p class="c1"><span class="c33">LinechartDatalet ha</span><span>s xAxisLabe,l yAxisLabel, title and suffix properties. This properties are used as layout params, and define respectively the label for the x-axis, y-axis, the title of the chart and the value suffix .</span></p><p class="c1 c7"><span class="c57"></span></p><p class="c1 c7"><span class="c54"></span></p><p class="c1 c7"><span class="c57"></span></p><p class="c1 c7"><span class="c33"></span></p><p class="c1"><span style="overflow: hidden; display: inline-block; margin: 0.00px 0.00px; border: 0.00px solid #000000; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px); width: 624.00px; height: 322.67px;"><img alt="" src="images/image02.png" style="width: 624.00px; height: 322.67px; margin-left: 0.00px; margin-top: 0.00px; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px);" title=""></span></p><p class="c1 c7"><span></span></p><p class="c1 c7"><span></span></p><p class="c1 c7"><span></span></p><h3 class="c19 c1"><a name="h.ve1g902t8v"></a><span class="c26 c20">Barchart datalet</span></h3><p class="c1 c7"><span></span></p><p class="c1"><span>The barchart-datalet will use the highchart-datalet to visualize a barchart. </span></p><p class="c1 c7"><span class="c39"></span></p><p class="c1"><span class="c2 c8">&lt;link</span><span class="c2">&nbsp;</span><span class="c2 c6">rel</span><span class="c2 c4">=</span><span class="c2 c17">&quot;import&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">href</span><span class="c2 c4">=</span><span class="c2 c17">&quot;../highcharts-datalet/highcharts-datalet.html&quot;&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2 c8">&lt;dom-module</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">name</span><span class="c2 c4">=</span><span class="c2 c17">&quot;barchart-datalet&quot;&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c8">&lt;template&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;highcharts-datalet</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">id</span><span class="c2 c4">=</span><span class="c2 c17">&quot;charts&quot;</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">data-url</span><span class="c2 c4">=</span><span class="c2 c17">&quot;{{dataUrl}}&quot;</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">fields</span><span class="c2 c4">=</span><span class="c2 c17">&quot;{{fields}}&quot;</span><span class="c2 c8">&gt;&lt;/highcharts-datalet&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c8">&lt;/template&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c8">&lt;script&gt;</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">BarchartBehavior</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;{</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Bluid</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Highchart</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">object</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@method</span><span class="c2 c5">&nbsp;transformData</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;presentData</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$</span><span class="c2 c4">(</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">$</span><span class="c2 c4">.</span><span class="c2 c5">charts</span><span class="c2 c4">.</span><span class="c2 c5">$</span><span class="c2 c4">.</span><span class="c2 c5">container</span><span class="c2 c4">).</span><span class="c2 c5">highcharts</span><span class="c2 c4">({</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;chart</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;bar&#39;,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;zoomType</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;xy&#39;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;title</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;text</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">title</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xAxis</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;categories</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">properties</span><span class="c2 c4">.</span><span class="c2 c5">categories</span><span class="c2 c4">.</span><span class="c2 c5">value,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;title</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;text</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">xAxisLabel</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;yAxis</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;min</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c0">0,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;title</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;text</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">yAxisLabel,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;align</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;high&#39;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;labels</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;overflow</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;justify&#39;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tooltip</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;valueSuffix</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39; &#39;</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">+</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">suffix</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;plotOptions</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bar</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dataLabels</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enabled</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">true</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;legend</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;layout</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;vertical&#39;,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;align</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;right&#39;,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;verticalAlign</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;top&#39;,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;x</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">-</span><span class="c0">40,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;y</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c0">100,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;floating</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">true,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;borderWidth</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c0">1,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;backgroundColor</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">((</span><span class="c2 c6">Highcharts</span><span class="c2 c4">.</span><span class="c2 c5">theme </span><span class="c2 c4">&amp;&amp;</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Highcharts</span><span class="c2 c4">.</span><span class="c2 c5">theme</span><span class="c2 c4">.</span><span class="c2 c5">legendBackgroundColor</span><span class="c2 c4">)</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">||</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;#FFFFFF&#39;</span><span class="c2 c4">),</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;shadow</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">true</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;credits</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enabled</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">false</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;series</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">properties</span><span class="c2 c4">.</span><span class="c2 c5">series</span><span class="c2 c4">.</span><span class="c2 c5">value</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">});</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">};</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c6">BarchartDatalet</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Polymer</span><span class="c2 c4">({</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">is</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;barchart-datalet&#39;,</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;properties</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">It</span><span class="c2 c17">&#39;s the label for X axis</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@attribute</span><span class="c2 c5">&nbsp;xAxisLabel</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@type</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">String</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@default</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;&#39;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xAxisLabel</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">String,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;&quot;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">It</span><span class="c2 c17">&#39;s the label for Y axis</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@attribute</span><span class="c2 c5">&nbsp;yAxisLabel</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@type</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">String</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@default</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;&#39;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;yAxisLabel</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">String,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;&quot;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">It</span><span class="c2 c17">&#39;s the title of the chart</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@attribute</span><span class="c2 c5">&nbsp;title</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@type</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Strig</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@default</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;&#39;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;title</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">String,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;Heading&quot;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">It</span><span class="c2 c17">&#39;s the values suffix</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@attribute</span><span class="c2 c5">&nbsp;suffix</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@type</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Strig</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@default</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;units&#39;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;suffix </span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type </span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">String,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value </span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;units&quot;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;ready&#39;</span><span class="c2 c5">&nbsp;callback extend the </span><span class="c2 c6">BarchartComponentBehavior</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">with</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">HighchartsComponentBehavior</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">and</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">BarchartBehavior</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">and</span><span class="c2 c5">&nbsp;run the </span><span class="c2 c6">Datalet</span><span class="c2 c5">&nbsp;workcycle.</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@method</span><span class="c2 c5">&nbsp;ready</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ready</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">BarchartComponentBehavior</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;$</span><span class="c2 c4">.</span><span class="c2 c5">extend</span><span class="c2 c4">(</span><span class="c2 c8">true</span><span class="c2 c4">,</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">{},</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">HighchartsComponentBehavior</span><span class="c2 c4">,</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">BarchartBehavior</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c6">BarchartComponentBehavior</span><span class="c2 c4">.</span><span class="c2 c5">init</span><span class="c2 c4">(</span><span class="c2 c8">this</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">});</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c8">&lt;/script&gt;</span></p><p class="c1"><span class="c2 c8">&lt;/dom-module&gt;</span></p><p class="c1 c7"><span class="c2 c8"></span></p><p class="c1"><span style="overflow: hidden; display: inline-block; margin: 0.00px 0.00px; border: 0.00px solid #000000; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px); width: 624.00px; height: 324.00px;"><img alt="" src="images/image01.png" style="width: 624.00px; height: 324.00px; margin-left: 0.00px; margin-top: 0.00px; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px);" title=""></span></p><p class="c1 c7"><span></span></p><h3 class="c19 c1 c37"><a name="h.4krgu9mab6k2"></a></h3><h2 class="c28 c1"><a name="h.l8rhx6bh9kf"></a><span class="c24 c20">Datatable-datalet</span></h2><p class="c1 c7"><span></span></p><p class="c1"><span>To be more complete we present another example of datalet that is slightly different from previous ones: a table based datalet which use Datatables javascript library (</span><span class="c44"><a class="c15" href="https://www.google.com/url?q=https://www.datatables.net/&amp;sa=D&amp;usg=AFQjCNE6nKMIs1fA5sz4RDBfC7IHuWpY5w">https://www.datatables.net/</a></span><span>) to render a table. The main difference is that datatable-datalet component has a dynamic DOM built according to the size of data.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span class="c2 c8">&lt;link</span><span class="c2">&nbsp;</span><span class="c2 c6">rel</span><span class="c2 c4">=</span><span class="c2 c17">&quot;import&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">href</span><span class="c2 c4">=</span><span class="c2 c17">&quot;../base-ajax-json-jsonpath-datalet/base-ajax-json-jsonpath-datalet.html&quot;&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2 c8">&lt;dom-module</span><span class="c2">&nbsp;</span><span class="c2 c6">id</span><span class="c2 c4">=</span><span class="c2 c17">&quot;datatable-datalet&quot;&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;template&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;link</span><span class="c2">&nbsp;</span><span class="c2 c6">rel</span><span class="c2 c4">=</span><span class="c2 c17">&quot;stylesheet&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">href</span><span class="c2 c4">=</span><span class="c2 c17">&quot;js/DataTables-master/media/css/jquery.dataTables.min.css&quot;&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;table</span><span class="c2">&nbsp;</span><span class="c2 c6">id</span><span class="c2 c4">=</span><span class="c2 c17">&quot;datatable&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">class</span><span class="c2 c4">=</span><span class="c2 c17">&quot;table table-striped table-bordered&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">cellspacing</span><span class="c2 c4">=</span><span class="c2 c17">&quot;0&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">style</span><span class="c2 c4">=</span><span class="c2 c17">&quot;</span><span class="c2">height</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">auto</span><span class="c2 c4">;</span><span class="c2">&nbsp;width</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">auto</span><span class="c2 c4">;</span><span class="c2 c17">&quot;&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;/table&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;base-ajax-json-jsonpath-datalet</span><span class="c2">&nbsp;</span><span class="c2 c6">data-url</span><span class="c2 c4">=</span><span class="c2 c17">&quot;{{dataUrl}}&quot;</span><span class="c2">&nbsp;</span><span class="c2 c6">fields</span><span class="c2 c4">=</span><span class="c2 c17">&quot;{{fields}}&quot;</span><span class="c2 c8">&gt;&lt;/base-ajax-json-jsonpath-datalet&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;/template&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;script</span><span class="c2">&nbsp;</span><span class="c2 c6">src</span><span class="c2 c4">=</span><span class="c2 c17">&quot;js/DataTables-master/media/js/jquery.dataTables.js&quot;</span><span class="c2 c8">&gt;&lt;/script&gt;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;script&gt;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">var</span><span class="c2">&nbsp;</span><span class="c2 c6">DatatableBehavior</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;{</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;presentData</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">if</span><span class="c2 c4">(!</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data </span><span class="c2 c4">||</span><span class="c2">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data </span><span class="c2 c4">==</span><span class="c2">&nbsp;</span><span class="c2 c8">undefined</span><span class="c2 c4">)</span><span class="c2">&nbsp;</span><span class="c2 c8">return;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;html </span><span class="c2 c4">=</span><span class="c2">&nbsp;</span><span class="c2 c17">&quot;&quot;;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;html </span><span class="c2 c4">+=</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;&lt;thead&gt;&#39;+</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c17">&#39;&lt;tr&gt;&#39;;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">for</span><span class="c2 c4">(</span><span class="c2 c8">var</span><span class="c2">&nbsp;x </span><span class="c2 c4">=</span><span class="c2">&nbsp;</span><span class="c0">0</span><span class="c2 c4">;</span><span class="c2">&nbsp;x</span><span class="c2 c4">&lt;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data</span><span class="c2 c4">.</span><span class="c2">length</span><span class="c2 c4">;</span><span class="c2">&nbsp;x</span><span class="c2 c4">++){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; html </span><span class="c2 c4">+=</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;&lt;th&gt;&#39;</span><span class="c2">&nbsp;</span><span class="c2 c4">+</span><span class="c2">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data</span><span class="c2 c4">[</span><span class="c2">x</span><span class="c2 c4">].</span><span class="c2">name </span><span class="c2 c4">+</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;&lt;/th&gt;&#39;;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;html </span><span class="c2 c4">+=</span><span class="c2">&nbsp; </span><span class="c2 c17">&#39;&lt;/tr&gt;&#39;</span><span class="c2">&nbsp;+</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c17">&#39;&lt;/thead&gt;&#39;</span><span class="c2">&nbsp;+</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c17">&#39;&lt;tfoot&gt;&#39;</span><span class="c2">&nbsp;+</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c17">&#39;&lt;tr&gt;&#39;;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">for</span><span class="c2 c4">(</span><span class="c2 c8">var</span><span class="c2">&nbsp;x </span><span class="c2 c4">=</span><span class="c2">&nbsp;</span><span class="c0">0</span><span class="c2 c4">;</span><span class="c2">&nbsp;x</span><span class="c2 c4">&lt;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data</span><span class="c2 c4">.</span><span class="c2">length</span><span class="c2 c4">;</span><span class="c2">&nbsp;x</span><span class="c2 c4">++){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;html </span><span class="c2 c4">+=</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;&lt;th&gt;&#39;</span><span class="c2">&nbsp;</span><span class="c2 c4">+</span><span class="c2">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data</span><span class="c2 c4">[</span><span class="c2">x</span><span class="c2 c4">].</span><span class="c2">name </span><span class="c2 c4">+</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;&lt;/th&gt;&#39;;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;html </span><span class="c2 c4">+=</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;&lt;/tr&gt;&#39;</span><span class="c2">&nbsp;+</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c17">&#39;&lt;/tfoot&gt;&#39;</span><span class="c2">&nbsp;+</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c17">&#39;&lt;tbody&gt;&#39;;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">for</span><span class="c2 c4">(</span><span class="c2 c8">var</span><span class="c2">&nbsp;i </span><span class="c2 c4">=</span><span class="c2">&nbsp;</span><span class="c0">0</span><span class="c2 c4">;</span><span class="c2">&nbsp;i</span><span class="c2 c4">&lt;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data</span><span class="c2 c4">[</span><span class="c0">0</span><span class="c2 c4">].</span><span class="c2">data</span><span class="c2 c4">.</span><span class="c2">length</span><span class="c2 c4">;</span><span class="c2">&nbsp;i</span><span class="c2 c4">++){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;html </span><span class="c2 c4">+=</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;&lt;tr&gt;&#39;;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">for</span><span class="c2 c4">(</span><span class="c2 c8">var</span><span class="c2">&nbsp;x </span><span class="c2 c4">=</span><span class="c2">&nbsp;</span><span class="c0">0</span><span class="c2 c4">;</span><span class="c2">&nbsp;x</span><span class="c2 c4">&lt;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data</span><span class="c2 c4">.</span><span class="c2">length</span><span class="c2 c4">;</span><span class="c2">&nbsp;x</span><span class="c2 c4">++){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;html </span><span class="c2 c4">+=</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;&lt;td&gt;&#39;</span><span class="c2">&nbsp;</span><span class="c2 c4">+</span><span class="c2">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data</span><span class="c2 c4">[</span><span class="c2">x</span><span class="c2 c4">].</span><span class="c2">data</span><span class="c2 c4">[</span><span class="c2">i</span><span class="c2 c4">]</span><span class="c2">&nbsp;</span><span class="c2 c4">+</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;&lt;/td&gt;&#39;;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;html </span><span class="c2 c4">+=</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;&lt;/tr&gt;&#39;;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;html </span><span class="c2 c4">+=</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;&lt;/tbody&gt;&#39;;</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$</span><span class="c2 c4">(</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">_component</span><span class="c2 c4">.</span><span class="c2">$</span><span class="c2 c4">.</span><span class="c2">datatable</span><span class="c2 c4">).</span><span class="c2">append</span><span class="c2 c4">(</span><span class="c2">html</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$</span><span class="c2 c4">(</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">_component</span><span class="c2 c4">.</span><span class="c2">$</span><span class="c2 c4">.</span><span class="c2">datatable</span><span class="c2 c4">).</span><span class="c2 c6">DataTable</span><span class="c2 c4">();</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">};</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c6">Polymer</span><span class="c2 c4">({</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">is</span><span class="c2">&nbsp;</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;datatable-datalet&#39;</span><span class="c2">&nbsp;,</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ready</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">var</span><span class="c2">&nbsp;</span><span class="c2 c6">DatatableComponentBehavior</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp; $</span><span class="c2 c4">.</span><span class="c2">extend</span><span class="c2 c4">(</span><span class="c2 c8">true</span><span class="c2 c4">,</span><span class="c2">&nbsp;</span><span class="c2 c4">{},</span><span class="c2">&nbsp;</span><span class="c2 c6">BaseDataletBehavior</span><span class="c2 c4">,</span><span class="c2">&nbsp;</span><span class="c2 c6">WorkcycleBehavior</span><span class="c2 c4">,</span><span class="c2">&nbsp;</span><span class="c2 c6">AjaxJsonJsonPathBehavior</span><span class="c2 c4">,</span><span class="c2">&nbsp;</span><span class="c2 c6">DatatableBehavior</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c6">DatatableComponentBehavior</span><span class="c2 c4">.</span><span class="c2">init</span><span class="c2 c4">(</span><span class="c2 c8">this</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">});</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c8">&lt;/script&gt;</span></p><p class="c1"><span class="c2 c8">&lt;/dom-module&gt;</span></p><h2 class="c28 c1"><a name="h.p6eipyeci0pi"></a><span class="c24 c20">Component documentation</span></h2><p class="c1 c7"><span class="c35 c20"></span></p><p class="c1"><span>To document a web component you can use a </span><span class="c16">iron-component-page </span><span>polymer component (https://elements.polymer-project.org/elements/iron-component-page). Each component must be documented to make DEEP able to give information about available components and their usage.</span></p><p class="c1"><span>Documentation can be encoded into html comments (&lt;!-- ... --&gt;) or using JsDoc notation (/** ... */). Markdown format is supported.</span></p><p class="c1"><span>Once you have properly commented the code to include the new component (datalet or controllet) to documentation you have to add the component path to source attribute.</span></p><h2 class="c1 c29"><a name="h.hchmkvzcaha3"></a><span>Deploy a new component</span></h2><p class="c1"><span>Here are described all the mandatory steps for Datalet deploy on DEEP.</span></p><h3 class="c1 c29"><a name="h.biecd569lsp"></a><span>Datalet directory structure</span></h3><p class="c1 c7"><span class="c20"></span></p><p class="c1"><span class="c2 c5">datalet</span><span class="c2 c4">-</span><span class="c2 c5">name</span></p><p class="c1"><span class="c2 c4">|------------</span><span class="c2 c5">datalet</span><span class="c2 c4">-</span><span class="c2 c5">name</span><span class="c2 c4">.</span><span class="c2 c5">png</span></p><p class="c1"><span class="c2 c4">|------------</span><span class="c2 c5">datalet</span><span class="c2 c4">-</span><span class="c2 c5">name</span><span class="c2 c4">.</span><span class="c2 c5">html</span></p><p class="c1"><span class="c2 c4">|------------</span><span class="c2 c5">demo</span></p><p class="c1"><span class="c2 c4">|</span><span class="c2 c5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="c2 c4">|-----</span><span class="c2 c5">index</span><span class="c2 c4">.</span><span class="c2 c5">html</span></p><p class="c1"><span class="c2 c4">|------------</span><span class="c2 c5">docs</span><span class="c2 c4">.</span><span class="c2 c5">html</span></p><p class="c1"><span class="c2 c4">|------------</span><span class="c2 c5">js*</span></p><p class="c1 c10 c50"><span class="c2 c4">|------</span><span class="c2 c5">vendor*</span></p><p class="c1 c10 c50"><span class="c2 c4">|------</span><span class="c2 c5">files</span><span class="c2 c4">.</span><span class="c2 c5">js*</span></p><p class="c1"><span class="c2 c4">|------------</span><span class="c2 c5">images*</span></p><p class="c1 c7"><span></span></p><ul class="c18 lst-kix_j1pbyefbfchs-0 start"><li class="c1 c3"><span>datalet-name.png : is a thumbnail preview of the Datalet</span></li><li class="c1 c3"><span>datalet-name.html : contains all the Datalet html source code</span></li><li class="c1 c3"><span>demo/index.html : is a html page with a static demo of the Datalet </span></li><li class="c1 c3"><span>docs.html : is a static html page with the documentation of the Datalet, made with </span><span class="c16">iron-component-page </span><span>Polymer component</span></li><li class="c1 c3"><span>js : is an optional directory where all the vendor/3rd-parties js library goes and, eventually, the datalet external js code</span></li><li class="c1 c3"><span>images : is an optional directory cointaining all the images used by the Datalet</span></li></ul><p class="c1 c7"><span></span></p><h3 class="c1 c29"><a name="h.8vkbn4c7d1kb"></a><span>Deploy</span></h3><p class="c1 c7"><span class="c20"></span></p><p class="c1"><span>To deploy a new component you have to :</span></p><p class="c1 c7"><span></span></p><ul class="c18 lst-kix_xpt451iyqej1-0 start"><li class="c1 c3"><span>Upload the new component (html, javascripts and stylesheets) in /COMPONENTS/</span><span class="c20">type-of-component</span><span>{datalets/controllets}/</span><span class="c20">name-of-component</span><span>&nbsp;directory. For instance if you have created a </span><span class="c16">my-datalet </span><span>component you have to copy it in</span><span class="c16">&nbsp;/COMPONENTS/datalets/my-datales/my-datalets-file</span><span>(html, js, css). </span></li><li class="c1 c3"><span>Add a component tag in xml file located in DEEP project: datalets.xml, for a new datalet, controllets.xml, for a new controllet. For instance if you created </span><span class="c16">my-datalet</span><span>&nbsp;component you have to add to datalets.xml the follow example snippet:</span></li></ul><p class="c1 c7"><span></span></p><p class="c1"><span class="c2 c8">&lt;component&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c8">&lt;name&gt;</span><span class="c2 c5">linechart-datalet</span><span class="c2 c8">&lt;/name&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c8">&lt;attributes&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;attribute&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;name&gt;</span><span class="c2 c5">data-url</span><span class="c2 c8">&lt;/name&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;/attribute&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;attribute&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;name&gt;</span><span class="c2 c5">fields</span><span class="c2 c8">&lt;/name&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;/attribute&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c8">&lt;/attributes&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c8">&lt;idm&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;inputs&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;input&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;name&gt;</span><span class="c2 c5">Categories</span><span class="c2 c8">&lt;/name&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;description&gt;</span><span class="c2 c5">The chart categories. Its values will be put in the horizontal axis. You need one value for each series.</span><span class="c2 c8">&lt;/description&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;scale&gt;</span><span class="c2 c5">nominal</span><span class="c2 c8">&lt;/scale&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;role&gt;</span><span class="c2 c5">domain</span><span class="c2 c8">&lt;/role&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;selection&gt;</span><span class="c2 c5">11</span><span class="c2 c8">&lt;/selection&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;/input&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;input&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;name&gt;</span><span class="c2 c5">Series</span><span class="c2 c8">&lt;/name&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;description&gt;</span><span class="c2 c5">The chart series. Its values will be put in the vertical axis.</span><span class="c2 c8">&lt;/description&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;scale&gt;</span><span class="c2 c5">nominal</span><span class="c2 c8">&lt;/scale&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;role&gt;</span><span class="c2 c5">domain</span><span class="c2 c8">&lt;/role&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;selection&gt;</span><span class="c2 c5">11</span><span class="c2 c8">&lt;/selection&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;/input&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;layouts&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;input&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;name&gt;</span><span class="c2 c5">title</span><span class="c2 c8">&lt;/name&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;description&gt;</span><span class="c2 c5">The label for the title of the chart</span><span class="c2 c8">&lt;/description&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;/input&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;input&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;name&gt;</span><span class="c2 c5">x-axis-label</span><span class="c2 c8">&lt;/name&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;description&gt;</span><span class="c2 c5">The label for the X axis</span><span class="c2 c8">&lt;/description&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;/input&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;input&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;name&gt;</span><span class="c2 c5">y-axis-label</span><span class="c2 c8">&lt;/name&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;description&gt;</span><span class="c2 c5">The label for the Y axis</span><span class="c2 c8">&lt;/description&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;/input&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;input&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;name&gt;</span><span class="c2 c5">suffix</span><span class="c2 c8">&lt;/name&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;description&gt;</span><span class="c2 c5">The values suffix(eg units, dollars, euro, ...)</span><span class="c2 c8">&lt;/description&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;/input&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;/layouts&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">&lt;/inputs&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c8">&lt;/idm&gt;</span></p><p class="c1"><span class="c2 c8">&lt;/component&gt;</span></p><p class="c1 c7"><span class="c2 c8"></span></p><p class="c1 c7"><span class="c2 c8"></span></p><p class="c1 c10 c7"><span class="c34"></span></p><p class="c1"><span>You should expose all attributes (adding attributes tags) in order to make the DEEP able to give this information when your component will be requested. </span></p><h1 class="c28 c1"><a name="h.j1ju11botx5f"></a><span class="c59">MISC</span></h1><h2 class="c1 c28"><a name="h.lj7afoxzjwpx"></a><span class="c20 c62">Integrated Development Environment: phpStorm</span></h2><p class="c1"><span>As an Integrated Development Environment (IDE) for PHP and web &nbsp;component, &nbsp;</span><span class="c16">JetBrains Phpstorm </span><span>(</span><span class="c44"><a class="c15" href="https://www.google.com/url?q=https://www.jetbrains.com/phpstorm/&amp;sa=D&amp;usg=AFQjCNEFja53k_-6LipN1wDXc50cD6czpw">https://www.jetbrains.com/phpstorm/</a></span><span>&nbsp;) has been chosen, but any other ide can be used. PhpStorm provides an editor as support for PHP, HTML, Javascript, CSS and many other languages. </span></p><h2 class="c28 c1"><a name="h.dj5v4msbbn4q"></a><span class="c24 c20">Useful Links</span></h2><p class="c1 c7"><span></span></p><a href="#" name="a37771d9fdc78727aa7a964cfa21f98ee39440b1"></a><a href="#" name="1"></a><table cellpadding="0" cellspacing="0" class="c21"><tbody><tr class="c14"><td class="c45" colspan="1" rowspan="1"><p class="c27 c1"><span class="c61 c5 c20">Description</span></p></td><td class="c45" colspan="1" rowspan="1"><p class="c27 c1"><span class="c5 c20 c61">Link</span></p></td></tr><tr class="c14"><td class="c45" colspan="1" rowspan="1"><p class="c27 c1"><span>Web Components</span></p></td><td class="c45" colspan="1" rowspan="1"><p class="c27 c1"><span class="c44 c20"><a class="c15" href="https://www.google.com/url?q=http://webcomponents.org/&amp;sa=D&amp;usg=AFQjCNEXztPINwsn6FIolcu896CfGQRIYA">http://webcomponents.org/</a></span><span class="c61 c5 c20">&nbsp;</span></p></td></tr><tr class="c14"><td class="c45" colspan="1" rowspan="1"><p class="c27 c1"><span class="c38 c5">Polymer</span></p></td><td class="c45" colspan="1" rowspan="1"><p class="c27 c1"><span class="c44"><a class="c15" href="https://www.google.com/url?q=https://www.polymer-project.org/1.0/&amp;sa=D&amp;usg=AFQjCNFlxPkCpKMiguvzlQy1HZn5v-2LGQ">https://www.polymer-project.org/1.0/</a></span><span class="c38 c5">&nbsp;</span></p></td></tr><tr class="c14"><td class="c45" colspan="1" rowspan="1"><p class="c1 c27"><span class="c38 c5">Google Web Component: a collection of web component for Google APIs, built with Polymer</span></p></td><td class="c45" colspan="1" rowspan="1"><p class="c27 c1"><span class="c44"><a class="c15" href="https://www.google.com/url?q=https://googlewebcomponents.github.io/&amp;sa=D&amp;usg=AFQjCNEqNNdAtF8iltMOlckek-14C97pYQ">https://googlewebcomponents.github.io/</a></span><span class="c38 c5">&nbsp;</span></p></td></tr><tr class="c14"><td class="c45" colspan="1" rowspan="1"><p class="c1 c60"><span class="c38 c5">Web Components Current Status</span></p><p class="c27 c1 c7"><span class="c38 c5"></span></p></td><td class="c45" colspan="1" rowspan="1"><p class="c27 c1"><span class="c44"><a class="c15" href="https://www.google.com/url?q=http://www.w3.org/standards/techs/components%23w3c_all&amp;sa=D&amp;usg=AFQjCNFhZyfEvNeFHc1IZSi2ejRauhat-w">http://www.w3.org/standards/techs/components#w3c_all</a></span></p></td></tr><tr class="c14"><td class="c45" colspan="1" rowspan="1"><p class="c60 c1"><span class="c38 c5">Introduction to Web Components</span></p><h1 class="c28 c1 c30 c75"><a name="h.mlmwy1tv4rs3"></a></h1></td><td class="c45" colspan="1" rowspan="1"><p class="c27 c1"><span class="c44"><a class="c15" href="https://www.google.com/url?q=http://www.w3.org/TR/components-intro/&amp;sa=D&amp;usg=AFQjCNGTGtqk71CcDN1m_cXzmI3juKxK1Q">http://www.w3.org/TR/components-intro/</a></span></p></td></tr></tbody></table><p class="c1 c7"><span></span></p><p class="c1 c7"><span></span></p><p class="c1 c7"><span></span></p><p class="c1 c7"><span></span></p><p class="c1 c7"><span></span></p></body></html>
2 1 \ No newline at end of file
  2 +<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><style type="text/css">@import url('https://themes.googleusercontent.com/fonts/css?kit=lhDjYqiy3mZ0x6ROQEUoUw');.lst-kix_caqenjpjbamt-2>li:before{content:"\0025a0 "}.lst-kix_caqenjpjbamt-1>li:before{content:"\0025cb "}.lst-kix_caqenjpjbamt-3>li:before{content:"\0025cf "}.lst-kix_caqenjpjbamt-0>li:before{content:"\0025cf "}.lst-kix_caqenjpjbamt-4>li:before{content:"\0025cb "}.lst-kix_caqenjpjbamt-6>li:before{content:"\0025cf "}.lst-kix_caqenjpjbamt-5>li:before{content:"\0025a0 "}.lst-kix_caqenjpjbamt-7>li:before{content:"\0025cb "}.lst-kix_caqenjpjbamt-8>li:before{content:"\0025a0 "}ol.lst-kix_cktmoc41t532-0.start{counter-reset:lst-ctn-kix_cktmoc41t532-0 0}.lst-kix_w0lbiu9bsebc-1>li:before{content:"\0025cb "}.lst-kix_w0lbiu9bsebc-2>li:before{content:"\0025a0 "}ol.lst-kix_cktmoc41t532-6.start{counter-reset:lst-ctn-kix_cktmoc41t532-6 0}.lst-kix_w0lbiu9bsebc-0>li:before{content:"\0025cf "}.lst-kix_mwbvd56bd501-5>li:before{content:"\0025a0 "}ol.lst-kix_cktmoc41t532-1.start{counter-reset:lst-ctn-kix_cktmoc41t532-1 0}.lst-kix_23werwvisbhd-0>li:before{content:"\0025cf "}.lst-kix_w0lbiu9bsebc-7>li:before{content:"\0025cb "}.lst-kix_23werwvisbhd-1>li:before{content:"\0025cb "}.lst-kix_mwbvd56bd501-6>li:before{content:"\0025cf "}.lst-kix_w0lbiu9bsebc-6>li:before{content:"\0025cf "}.lst-kix_23werwvisbhd-3>li:before{content:"\0025cf "}.lst-kix_23werwvisbhd-4>li:before{content:"\0025cb "}.lst-kix_w0lbiu9bsebc-3>li:before{content:"\0025cf "}.lst-kix_w0lbiu9bsebc-5>li:before{content:"\0025a0 "}.lst-kix_mwbvd56bd501-7>li:before{content:"\0025cb "}.lst-kix_23werwvisbhd-2>li:before{content:"\0025a0 "}.lst-kix_mwbvd56bd501-8>li:before{content:"\0025a0 "}.lst-kix_w0lbiu9bsebc-4>li:before{content:"\0025cb "}.lst-kix_23werwvisbhd-7>li:before{content:"\0025cb "}.lst-kix_23werwvisbhd-8>li:before{content:"\0025a0 "}.lst-kix_23werwvisbhd-5>li:before{content:"\0025a0 "}.lst-kix_23werwvisbhd-6>li:before{content:"\0025cf "}.lst-kix_w0lbiu9bsebc-8>li:before{content:"\0025a0 "}.lst-kix_cktmoc41t532-2>li{counter-increment:lst-ctn-kix_cktmoc41t532-2}ol.lst-kix_cktmoc41t532-7.start{counter-reset:lst-ctn-kix_cktmoc41t532-7 0}.lst-kix_cktmoc41t532-5>li{counter-increment:lst-ctn-kix_cktmoc41t532-5}.lst-kix_iy595p3cktj3-2>li:before{content:"\0025a0 "}.lst-kix_oia1ur76tkla-6>li:before{content:"\0025cf "}.lst-kix_oia1ur76tkla-4>li:before{content:"\0025cb "}.lst-kix_oia1ur76tkla-8>li:before{content:"\0025a0 "}.lst-kix_z1db35cwkqzv-0>li:before{content:"\0025cf "}.lst-kix_z1db35cwkqzv-4>li:before{content:"\0025cb "}.lst-kix_iy595p3cktj3-6>li:before{content:"\0025cf "}ul.lst-kix_xpt451iyqej1-5{list-style-type:none}ul.lst-kix_xpt451iyqej1-4{list-style-type:none}ul.lst-kix_xpt451iyqej1-3{list-style-type:none}ul.lst-kix_xpt451iyqej1-2{list-style-type:none}.lst-kix_iy595p3cktj3-4>li:before{content:"\0025cb "}.lst-kix_cktmoc41t532-4>li{counter-increment:lst-ctn-kix_cktmoc41t532-4}ul.lst-kix_xpt451iyqej1-8{list-style-type:none}ul.lst-kix_xpt451iyqej1-7{list-style-type:none}ul.lst-kix_xpt451iyqej1-6{list-style-type:none}.lst-kix_z1db35cwkqzv-6>li:before{content:"\0025cf "}.lst-kix_xpt451iyqej1-5>li:before{content:"\0025a0 "}.lst-kix_z1db35cwkqzv-8>li:before{content:"\0025a0 "}.lst-kix_iy595p3cktj3-8>li:before{content:"\0025a0 "}.lst-kix_cktmoc41t532-3>li{counter-increment:lst-ctn-kix_cktmoc41t532-3}.lst-kix_xpt451iyqej1-7>li:before{content:"\0025cb "}ol.lst-kix_cktmoc41t532-2.start{counter-reset:lst-ctn-kix_cktmoc41t532-2 0}ol.lst-kix_cktmoc41t532-5{list-style-type:none}ol.lst-kix_cktmoc41t532-6{list-style-type:none}ol.lst-kix_cktmoc41t532-7{list-style-type:none}ol.lst-kix_cktmoc41t532-8{list-style-type:none}ul.lst-kix_w0lbiu9bsebc-8{list-style-type:none}ul.lst-kix_w0lbiu9bsebc-6{list-style-type:none}ul.lst-kix_w0lbiu9bsebc-7{list-style-type:none}ol.lst-kix_cktmoc41t532-0{list-style-type:none}ul.lst-kix_w0lbiu9bsebc-4{list-style-type:none}.lst-kix_oia1ur76tkla-0>li:before{content:"\0025cf "}ol.lst-kix_cktmoc41t532-1{list-style-type:none}ul.lst-kix_w0lbiu9bsebc-5{list-style-type:none}ol.lst-kix_cktmoc41t532-2{list-style-type:none}ul.lst-kix_w0lbiu9bsebc-2{list-style-type:none}ol.lst-kix_cktmoc41t532-3{list-style-type:none}ul.lst-kix_w0lbiu9bsebc-3{list-style-type:none}ol.lst-kix_cktmoc41t532-4{list-style-type:none}ul.lst-kix_w0lbiu9bsebc-0{list-style-type:none}.lst-kix_oia1ur76tkla-2>li:before{content:"\0025a0 "}ul.lst-kix_w0lbiu9bsebc-1{list-style-type:none}.lst-kix_iy595p3cktj3-0>li:before{content:"\0025cf "}.lst-kix_mwbvd56bd501-3>li:before{content:"\0025cf "}.lst-kix_z1db35cwkqzv-2>li:before{content:"\0025a0 "}.lst-kix_mwbvd56bd501-1>li:before{content:"\0025cb "}ol.lst-kix_cktmoc41t532-5.start{counter-reset:lst-ctn-kix_cktmoc41t532-5 0}.lst-kix_oldlfkxmjbuj-5>li:before{content:"\0025a0 "}.lst-kix_xpt451iyqej1-1>li:before{content:"\0025cb "}.lst-kix_oldlfkxmjbuj-7>li:before{content:"\0025cb "}.lst-kix_xpt451iyqej1-3>li:before{content:"\0025cf "}ol.lst-kix_cktmoc41t532-4.start{counter-reset:lst-ctn-kix_cktmoc41t532-4 0}ul.lst-kix_xpt451iyqej1-1{list-style-type:none}ul.lst-kix_xpt451iyqej1-0{list-style-type:none}ol.lst-kix_cktmoc41t532-3.start{counter-reset:lst-ctn-kix_cktmoc41t532-3 0}.lst-kix_cktmoc41t532-0>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-0,decimal) ". "}.lst-kix_cktmoc41t532-1>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-1,lower-latin) ". "}.lst-kix_oldlfkxmjbuj-4>li:before{content:"\0025cb "}ul.lst-kix_caqenjpjbamt-4{list-style-type:none}.lst-kix_cktmoc41t532-4>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-4,lower-latin) ". "}ul.lst-kix_caqenjpjbamt-3{list-style-type:none}ul.lst-kix_caqenjpjbamt-6{list-style-type:none}.lst-kix_oldlfkxmjbuj-3>li:before{content:"\0025cf "}ul.lst-kix_caqenjpjbamt-5{list-style-type:none}.lst-kix_j1pbyefbfchs-6>li:before{content:"\0025cf "}ul.lst-kix_caqenjpjbamt-8{list-style-type:none}.lst-kix_cktmoc41t532-2>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-2,lower-roman) ". "}.lst-kix_cktmoc41t532-6>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-6,decimal) ". "}ul.lst-kix_caqenjpjbamt-7{list-style-type:none}.lst-kix_cktmoc41t532-3>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-3,decimal) ". "}.lst-kix_cktmoc41t532-7>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-7,lower-latin) ". "}.lst-kix_oldlfkxmjbuj-2>li:before{content:"\0025a0 "}.lst-kix_j1pbyefbfchs-5>li:before{content:"\0025a0 "}.lst-kix_ucxv06xdi15q-7>li:before{content:"\0025cb "}.lst-kix_oldlfkxmjbuj-1>li:before{content:"\0025cb "}.lst-kix_j1pbyefbfchs-2>li:before{content:"\0025a0 "}.lst-kix_j1pbyefbfchs-4>li:before{content:"\0025cb "}.lst-kix_cktmoc41t532-5>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-5,lower-roman) ". "}.lst-kix_ucxv06xdi15q-8>li:before{content:"\0025a0 "}.lst-kix_oldlfkxmjbuj-0>li:before{content:"\0025cf "}.lst-kix_j1pbyefbfchs-3>li:before{content:"\0025cf "}ul.lst-kix_23werwvisbhd-7{list-style-type:none}ul.lst-kix_23werwvisbhd-8{list-style-type:none}.lst-kix_ucxv06xdi15q-1>li:before{content:"\0025cb "}.lst-kix_ucxv06xdi15q-3>li:before{content:"\0025cf "}.lst-kix_j1pbyefbfchs-0>li:before{content:"\0025cf "}.lst-kix_ucxv06xdi15q-2>li:before{content:"\0025a0 "}.lst-kix_ucxv06xdi15q-6>li:before{content:"\0025cf "}.lst-kix_j1pbyefbfchs-1>li:before{content:"\0025cb "}ul.lst-kix_23werwvisbhd-1{list-style-type:none}.lst-kix_cktmoc41t532-8>li:before{content:"" counter(lst-ctn-kix_cktmoc41t532-8,lower-roman) ". "}ul.lst-kix_23werwvisbhd-2{list-style-type:none}ul.lst-kix_23werwvisbhd-0{list-style-type:none}.lst-kix_ucxv06xdi15q-5>li:before{content:"\0025a0 "}ul.lst-kix_23werwvisbhd-5{list-style-type:none}ul.lst-kix_caqenjpjbamt-0{list-style-type:none}ul.lst-kix_23werwvisbhd-6{list-style-type:none}ul.lst-kix_23werwvisbhd-3{list-style-type:none}ul.lst-kix_caqenjpjbamt-2{list-style-type:none}ul.lst-kix_23werwvisbhd-4{list-style-type:none}.lst-kix_ucxv06xdi15q-4>li:before{content:"\0025cb "}ul.lst-kix_caqenjpjbamt-1{list-style-type:none}ul.lst-kix_ucxv06xdi15q-1{list-style-type:none}ul.lst-kix_ucxv06xdi15q-2{list-style-type:none}ul.lst-kix_ucxv06xdi15q-0{list-style-type:none}ul.lst-kix_ucxv06xdi15q-5{list-style-type:none}ul.lst-kix_ucxv06xdi15q-6{list-style-type:none}ul.lst-kix_ucxv06xdi15q-3{list-style-type:none}ul.lst-kix_ucxv06xdi15q-4{list-style-type:none}ul.lst-kix_ucxv06xdi15q-7{list-style-type:none}ul.lst-kix_ucxv06xdi15q-8{list-style-type:none}ol.lst-kix_cktmoc41t532-8.start{counter-reset:lst-ctn-kix_cktmoc41t532-8 0}.lst-kix_j1pbyefbfchs-7>li:before{content:"\0025cb "}.lst-kix_j1pbyefbfchs-8>li:before{content:"\0025a0 "}.lst-kix_cktmoc41t532-8>li{counter-increment:lst-ctn-kix_cktmoc41t532-8}.lst-kix_iy595p3cktj3-1>li:before{content:"\0025cb "}.lst-kix_iy595p3cktj3-3>li:before{content:"\0025cf "}.lst-kix_oia1ur76tkla-5>li:before{content:"\0025a0 "}.lst-kix_oia1ur76tkla-7>li:before{content:"\0025cb "}.lst-kix_z1db35cwkqzv-1>li:before{content:"\0025cb "}.lst-kix_z1db35cwkqzv-3>li:before{content:"\0025cf "}.lst-kix_iy595p3cktj3-5>li:before{content:"\0025a0 "}ul.lst-kix_oldlfkxmjbuj-0{list-style-type:none}.lst-kix_z1db35cwkqzv-5>li:before{content:"\0025a0 "}.lst-kix_z1db35cwkqzv-7>li:before{content:"\0025cb "}ul.lst-kix_oldlfkxmjbuj-1{list-style-type:none}ul.lst-kix_oldlfkxmjbuj-2{list-style-type:none}ul.lst-kix_oldlfkxmjbuj-3{list-style-type:none}ul.lst-kix_oldlfkxmjbuj-4{list-style-type:none}ul.lst-kix_oldlfkxmjbuj-5{list-style-type:none}ul.lst-kix_oia1ur76tkla-1{list-style-type:none}ul.lst-kix_oldlfkxmjbuj-6{list-style-type:none}ul.lst-kix_oia1ur76tkla-2{list-style-type:none}ul.lst-kix_oldlfkxmjbuj-7{list-style-type:none}.lst-kix_xpt451iyqej1-4>li:before{content:"\0025cb "}.lst-kix_xpt451iyqej1-6>li:before{content:"\0025cf "}ul.lst-kix_oldlfkxmjbuj-8{list-style-type:none}ul.lst-kix_oia1ur76tkla-0{list-style-type:none}ul.lst-kix_oia1ur76tkla-5{list-style-type:none}ul.lst-kix_iy595p3cktj3-8{list-style-type:none}ul.lst-kix_oia1ur76tkla-6{list-style-type:none}ul.lst-kix_oia1ur76tkla-3{list-style-type:none}ul.lst-kix_oia1ur76tkla-4{list-style-type:none}ul.lst-kix_iy595p3cktj3-5{list-style-type:none}ul.lst-kix_iy595p3cktj3-4{list-style-type:none}.lst-kix_iy595p3cktj3-7>li:before{content:"\0025cb "}ul.lst-kix_iy595p3cktj3-7{list-style-type:none}ul.lst-kix_oia1ur76tkla-7{list-style-type:none}ul.lst-kix_iy595p3cktj3-6{list-style-type:none}.lst-kix_xpt451iyqej1-8>li:before{content:"\0025a0 "}ul.lst-kix_oia1ur76tkla-8{list-style-type:none}ul.lst-kix_iy595p3cktj3-1{list-style-type:none}ul.lst-kix_iy595p3cktj3-0{list-style-type:none}ul.lst-kix_iy595p3cktj3-3{list-style-type:none}ul.lst-kix_iy595p3cktj3-2{list-style-type:none}.lst-kix_cktmoc41t532-1>li{counter-increment:lst-ctn-kix_cktmoc41t532-1}.lst-kix_oia1ur76tkla-1>li:before{content:"\0025cb "}.lst-kix_oia1ur76tkla-3>li:before{content:"\0025cf "}.lst-kix_mwbvd56bd501-4>li:before{content:"\0025cb "}ul.lst-kix_j1pbyefbfchs-8{list-style-type:none}.lst-kix_mwbvd56bd501-2>li:before{content:"\0025a0 "}ul.lst-kix_mwbvd56bd501-2{list-style-type:none}ul.lst-kix_mwbvd56bd501-3{list-style-type:none}ul.lst-kix_mwbvd56bd501-0{list-style-type:none}ul.lst-kix_mwbvd56bd501-1{list-style-type:none}.lst-kix_mwbvd56bd501-0>li:before{content:"\0025cf "}.lst-kix_cktmoc41t532-7>li{counter-increment:lst-ctn-kix_cktmoc41t532-7}.lst-kix_ucxv06xdi15q-0>li:before{content:"\0025cf "}ul.lst-kix_mwbvd56bd501-8{list-style-type:none}ul.lst-kix_mwbvd56bd501-6{list-style-type:none}ul.lst-kix_mwbvd56bd501-7{list-style-type:none}ul.lst-kix_mwbvd56bd501-4{list-style-type:none}ul.lst-kix_mwbvd56bd501-5{list-style-type:none}ul.lst-kix_j1pbyefbfchs-2{list-style-type:none}.lst-kix_cktmoc41t532-6>li{counter-increment:lst-ctn-kix_cktmoc41t532-6}ul.lst-kix_j1pbyefbfchs-3{list-style-type:none}ul.lst-kix_j1pbyefbfchs-0{list-style-type:none}ul.lst-kix_j1pbyefbfchs-1{list-style-type:none}.lst-kix_cktmoc41t532-0>li{counter-increment:lst-ctn-kix_cktmoc41t532-0}ul.lst-kix_j1pbyefbfchs-6{list-style-type:none}ul.lst-kix_j1pbyefbfchs-7{list-style-type:none}ul.lst-kix_j1pbyefbfchs-4{list-style-type:none}ul.lst-kix_j1pbyefbfchs-5{list-style-type:none}.lst-kix_oldlfkxmjbuj-6>li:before{content:"\0025cf "}ul.lst-kix_z1db35cwkqzv-2{list-style-type:none}ul.lst-kix_z1db35cwkqzv-3{list-style-type:none}ul.lst-kix_z1db35cwkqzv-0{list-style-type:none}.lst-kix_xpt451iyqej1-2>li:before{content:"\0025a0 "}ul.lst-kix_z1db35cwkqzv-1{list-style-type:none}.lst-kix_oldlfkxmjbuj-8>li:before{content:"\0025a0 "}ul.lst-kix_z1db35cwkqzv-8{list-style-type:none}ul.lst-kix_z1db35cwkqzv-6{list-style-type:none}ul.lst-kix_z1db35cwkqzv-7{list-style-type:none}ul.lst-kix_z1db35cwkqzv-4{list-style-type:none}ul.lst-kix_z1db35cwkqzv-5{list-style-type:none}.lst-kix_xpt451iyqej1-0>li:before{content:"\0025cf "}ol{margin:0;padding:0}.c25{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;background-color:#3d85c6;border-left-style:solid;border-bottom-width:1pt;width:114.7pt;border-top-color:#000000;border-bottom-style:solid}.c49{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;background-color:#3d85c6;border-left-style:solid;border-bottom-width:1pt;width:66.8pt;border-top-color:#000000;border-bottom-style:solid}.c46{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;background-color:#3d85c6;border-left-style:solid;border-bottom-width:1pt;width:192.8pt;border-top-color:#000000;border-bottom-style:solid}.c47{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;background-color:#3d85c6;border-left-style:solid;border-bottom-width:1pt;width:77.2pt;border-top-color:#000000;border-bottom-style:solid}.c64{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:66.8pt;border-top-color:#000000;border-bottom-style:solid}.c70{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:77.2pt;border-top-color:#000000;border-bottom-style:solid}.c72{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:114.7pt;border-top-color:#000000;border-bottom-style:solid}.c73{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:192.8pt;border-top-color:#000000;border-bottom-style:solid}.c45{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:1pt;border-right-width:1pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:1pt;border-top-style:solid;border-left-style:solid;border-bottom-width:1pt;width:225.7pt;border-top-color:#000000;border-bottom-style:solid}.c38{font-weight:normal;text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c51{color:#ffffff;text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c61{text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c27{padding-top:0pt;padding-bottom:0pt;line-height:1.0;text-align:left}.c34{background-color:#2b2b2b;font-size:8pt;font-family:"Courier New";color:#e8bf6a}.c36{background-color:#2b2b2b;font-size:8pt;font-family:"Courier New";color:#9876aa}.c22{background-color:#2b2b2b;font-size:8pt;font-family:"Courier New";color:#cc7832}.c23{background-color:#2b2b2b;font-size:9pt;font-family:"Courier New";color:#e8bf6a}.c60{padding-top:0pt;padding-bottom:0pt;line-height:1.15;text-align:left}.c13{font-size:12pt;font-family:"Trebuchet MS";color:#1155cc;text-decoration:underline}.c43{background-color:#ffffff;color:#1155cc;text-decoration:underline}.c19{padding-top:8pt;padding-bottom:0pt;page-break-after:avoid}.c26{font-size:12pt;font-family:"Trebuchet MS";color:#666666}.c77{background-color:#ffffff;max-width:451.4pt;padding:72pt 72pt 72pt 72pt}.c39{background-color:#2b2b2b;font-family:"Courier New";color:#e8bf6a}.c28{padding-top:10pt;padding-bottom:0pt;page-break-after:avoid}.c54{background-color:#2b2b2b;font-family:"Courier New";color:#9876aa}.c57{background-color:#344134;font-family:"Courier New";color:#a9b7c6}.c21{border-collapse:collapse;margin-right:auto}.c74{background-color:#f9f2f4;font-size:10pt;color:#c7254e}.c0{font-size:9pt;font-family:"Consolas";color:#006666}.c1{orphans:2;widows:2;direction:ltr}.c52{font-size:21pt;font-family:"Trebuchet MS"}.c75{line-height:1.15;text-align:left}.c44{color:#1155cc;text-decoration:underline}.c53{background-color:#ffffff;color:#222222}.c11{margin-left:72pt;padding-left:0pt}.c67{font-size:8pt;color:#e8bf6a}.c18{padding:0;margin:0}.c24{font-size:13pt;font-family:"Trebuchet MS"}.c71{padding-bottom:0pt;text-align:center}.c69{background-color:#ffffff;color:#0086b3}.c59{font-size:16pt;font-family:"Trebuchet MS"}.c56{background-color:#ffffff;color:#000080}.c55{background-color:#ffffff;color:#dd1144}.c33{background-color:#ffffff;color:#212121}.c15{color:inherit;text-decoration:inherit}.c76{font-size:8pt;color:#cc7832}.c42{background-color:#ffffff;color:#333333}.c2{font-size:9pt;font-family:"Consolas"}.c3{margin-left:36pt;padding-left:0pt}.c10{margin-left:36pt}.c30{height:20pt}.c29{page-break-after:avoid}.c6{color:#660066}.c50{text-indent:36pt}.c12{line-height:1.5}.c14{height:0pt}.c8{color:#000088}.c31{line-height:1.0}.c58{text-align:justify}.c32{margin-left:18pt}.c63{background-color:#2b2b2b}.c35{font-size:12pt}.c5{color:#000000}.c20{font-weight:bold}.c7{height:11pt}.c37{height:14pt}.c65{padding-bottom:10pt}.c9{color:#880000}.c62{font-size:13pt}.c4{color:#666600}.c41{font-family:"Consolas"}.c68{font-family:"Trebuchet MS"}.c40{margin-left:54pt}.c16{font-style:italic}.c48{direction:ltr}.c66{text-decoration:underline}.c17{color:#008800}.title{padding-top:0pt;color:#000000;font-size:26pt;padding-bottom:3pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}.subtitle{padding-top:0pt;color:#666666;font-size:15pt;padding-bottom:16pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}li{color:#000000;font-size:11pt;font-family:"Arial"}p{margin:0;color:#000000;font-size:11pt;font-family:"Arial"}h1{padding-top:20pt;color:#000000;font-size:20pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h2{padding-top:18pt;color:#000000;font-size:16pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h3{padding-top:16pt;color:#434343;font-size:14pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h4{padding-top:14pt;color:#666666;font-size:12pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h5{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h6{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;font-style:italic;orphans:2;widows:2;text-align:left}</style></head><body class="c77"><p class="c1 c29 c71 title"><a name="h.pkp3s2laag2t"></a><span class="c52">ROUTE-TO-PA Datalet Developer Guide</span></p><p class="c1 c7 c65"><span></span></p><a href="#" name="ac16fd65acb962b3dcde43864cc851d202c45178"></a><a href="#" name="0"></a><table cellpadding="0" cellspacing="0" class="c21"><tbody><tr class="c14"><td class="c49" colspan="1" rowspan="1"><p class="c27 c48"><span class="c51 c20">Revision</span></p></td><td class="c47" colspan="1" rowspan="1"><p class="c27 c48"><span class="c20 c51">Date</span></p></td><td class="c46" colspan="1" rowspan="1"><p class="c27 c48"><span class="c51 c20">Authors</span></p></td><td class="c25" colspan="1" rowspan="1"><p class="c27 c48"><span class="c51 c20">Comments</span></p></td></tr><tr class="c14"><td class="c64" colspan="1" rowspan="1"><p class="c27 c48"><span class="c38 c5">0.1</span></p></td><td class="c70" colspan="1" rowspan="1"><p class="c27 c48"><span class="c5 c38">15.10.2015</span></p></td><td class="c73" colspan="1" rowspan="1"><p class="c27 c48"><span class="c38 c5">Andrea Petta, Luigi Serra</span></p></td><td class="c72" colspan="1" rowspan="1"><p class="c27 c48"><span class="c38 c5">First version</span></p></td></tr></tbody></table><p class="c1 c7"><span class="c35 c20"></span></p><p class="c1 c32"><span class="c13"><a class="c15" href="#h.couwk1phskca">An architectural overview</a></span></p><p class="c1 c32"><span class="c13"><a class="c15" href="#h.urv1litmuehw">Code control system</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.6d53fxfci78h">Prerequisites</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.3fwzssauigko">Git</a></span></p><p class="c1 c32"><span class="c13"><a class="c15" href="#h.kq0jx6d2gu42">Keywords</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.2xi4iyxti3it">Web Component</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.waf9mw9uy47v">Polymer</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.oylshnr4dqms">webcomponents.js polyfills</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.wtrwkodajjel">Datalet</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.oa5t1t1cc2mn">Datalet lifecycle</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.qor0wy2nd780">Controllet</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.c8d89fu6xb9y">DatalEts Ecosystem Provider (DEEP)</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.juucc2j3piae">DEEPCLIENT</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.k19gs218be3l">DEEPCLIENT Usage:</a></span></p><p class="c1 c32"><span class="c13"><a class="c15" href="#h.pz7vvqc2atb">Components Tutorial (Polymer 1.0)</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.ig6fal8a8s2x">A behaviors based architecture</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.23494m888vls">An example of datalet for Highchart js library</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.qqdl4o86ucxr">Ajax-Json-JsonPath behavior</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.lmehzpjkgz75">Base datalet</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.6otvlqmjxt9s">base-ajax-json-jsonpath-datalet Datalet</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.5kn6d9gehrxp">Highcharts component</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.ns7fynbyet5s">Linechart datalet</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.ve1g902t8v">Barchart datalet</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.l8rhx6bh9kf">Datatable-datalet</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.p6eipyeci0pi">Component documentation</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.hchmkvzcaha3">Deploy a new component</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.biecd569lsp">Datalet directory structure</a></span></p><p class="c1 c40"><span class="c13"><a class="c15" href="#h.8vkbn4c7d1kb">Deploy</a></span></p><p class="c1 c32"><span class="c13"><a class="c15" href="#h.j1ju11botx5f">MISC</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.lj7afoxzjwpx">Integrated Development Environment: phpStorm</a></span></p><p class="c1 c10"><span class="c13"><a class="c15" href="#h.dj5v4msbbn4q">Useful Links</a></span></p><h1 class="c28 c1 c30"><a name="h.s3f4husqykcg"></a></h1><hr style="page-break-before:always;display:none;"><h1 class="c28 c1 c30"><a name="h.njs1zyw12f7z"></a></h1><h1 class="c28 c1"><a name="h.couwk1phskca"></a><span class="c59">An architectural overview</span></h1><p class="c1 c7"><span class="c20 c62"></span></p><p class="c1"><span>We&rsquo;ll briefly introduce our Datalet architectural design. </span></p><p class="c1 c7"><span></span></p><p class="c1"><span>We have three actors: </span></p><ul class="c18 lst-kix_oia1ur76tkla-0 start"><li class="c1 c3"><span>client page that exploit DEEP-Client functionality</span></li><li class="c1 c3"><span>DEEP (DatalEts Ecosystem Provider)</span></li><li class="c1 c3"><span>DEEP-Component</span></li></ul><p class="c1 c7"><span></span></p><p class="c1"><span>The DEEP-Client asks to DEEP for a specific Datalet, DEEP responds with the information necessary for the Datalet inclusion, the DEEP-Client retrieve the Datalet from DEEP-Component and include it into the page.</span></p><p class="c1"><span style="overflow: hidden; display: inline-block; margin: 0.00px 0.00px; border: 0.00px solid #000000; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px); width: 624.00px; height: 342.67px;"><img alt="SPOD__1_.png" src="images/image00.png" style="width: 624.00px; height: 342.67px; margin-left: 0.00px; margin-top: 0.00px; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px);" title=""></span></p><ul class="c18 lst-kix_z1db35cwkqzv-0 start"><li class="c1 c3 c31"><span class="c53">A HTML web page that dynamically includes webcomponents must include the </span><span class="c53 c20">DEEPCLIENT </span><span class="c53">Javascript library, configured with the URL of the DEEP repository.</span></li><li class="c1 c3 c31"><span class="c53">In the above image, a web page contains a </span><span class="c53 c20">data-table</span><span class="c53">&nbsp;webcomponent that is configured with a </span><span class="c74 c41">data_url</span><span class="c53">&nbsp;elements (an URL to a data-source) and a </span><span class="c41 c74">params</span><span class="c53">&nbsp;element (that may contain configuration parameters as requested by the webcomponent).</span></li><li class="c1 c3 c31"><span class="c53">DEEPCLIENT contacts DEEP and asks for the location of the data-table webcomponent.</span></li><li class="c1 c3 c31"><span class="c53">DEEP answers with the complete URL where the Client can download the data-table component.</span></li><li class="c1 c3 c31"><span class="c53">DEEPCLIENT sends a request to the aforementioned webcomponent URL and downloads the data-table webcomponent&#39;s code. We say that webcomponents are hosted by a DEEPCOMPONENT repository (basically a web server compatible with HTTP/Ajax that serves webcomponents&#39; HTML code).</span></li><li class="c1 c3 c31"><span class="c53">Once downloaded the data-table webcomponent&#39;s code can be placed in the HTML client page and rendered within the browser.</span></li></ul><p class="c1 c7 c12"><span class="c53"></span></p><h1 class="c28 c1"><a name="h.urv1litmuehw"></a><span class="c59">Code control system</span></h1><h2 class="c28 c1 c58"><a name="h.6d53fxfci78h"></a><span class="c35 c20">Prerequisites</span></h2><p class="c1 c7"><span></span></p><ul class="c18 lst-kix_w0lbiu9bsebc-0 start"><li class="c1 c3"><span>Web server with PHP support (DEEP is currently developed in PHP)</span></li><li class="c1 c3"><span>Git client</span></li></ul><h2 class="c28 c1"><a name="h.3fwzssauigko"></a><span class="c20 c62">Git</span></h2><p class="c1 c7"><span></span></p><p class="c1 c58"><span>Go to </span><span class="c44"><a class="c15" href="https://www.google.com/url?q=http://service.routetopa.eu:7480/users/sign_in&amp;sa=D&amp;usg=AFQjCNGrCFMrZzF4Ao1w1RrmCkv-Dw-s2Q">http://service.routetopa.eu:7480/users/sign_in</a></span><span>&nbsp;and create an account.</span></p><p class="c1 c58"><span>Send an email to GIT system administrator (specifying your email account on GIT) to be added into </span><span class="c20">WebCompDev </span><span>group.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>From terminal:</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>$ git config --global user.name &ldquo;YOUR NAME&rdquo;</span></p><p class="c1"><span>$ git config --global user.mail &ldquo;YOUR EMAIL ADDRESS&rdquo;</span></p><p class="c1"><span>&nbsp;</span></p><p class="c1"><span>Create a directory inside your public HTML web server directory, then :</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>$ git clone http://service.routetopa.eu:7480/isislab/DEEP.git</span></p><p class="c1"><span>$ git clone http://service.routetopa.eu:7480/isislab/DEEPCLIENT.git</span></p><p class="c1"><span>$ git clone http://service.routetopa.eu:7480/WebCompDev/COMPONENTS.git</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>now in your web server&#39;s local directory there are 3 new directory DEEP, DEEPCLIENT, COMPONENTS. </span></p><p class="c1 c7"><span></span></p><p class="c1"><span>Now we have to configure DEEP and DEEPCLIENT to work correctly on your environment.</span></p><p class="c1"><span>In DEEP directory edit file datalets.xml. Substitute the &lt;components_repository_url_reference&gt; value with the full URL of COMPONENTS/datalets just cloned, repeat the same operation for controllets.xml.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>In DEEPCLIENT edit file index.html and substitute ComponentService.deep_url with the correct DEEP URL.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>Now you can test the Datalet demo pointing the browser to DEEPCLIENT/index.html</span></p><p class="c1 c7"><span></span></p><hr style="page-break-before:always;display:none;"><p class="c1 c7"><span></span></p><h1 class="c28 c1"><a name="h.kq0jx6d2gu42"></a><span class="c59">Keywords</span></h1><p class="c1 c7"><span class="c20"></span></p><h2 class="c28 c1"><a name="h.2xi4iyxti3it"></a><span class="c24 c20">Web Component </span></h2><p class="c1"><span>Are a set of standards currently being produced by Google engineers as a W3C specification that allow for the creation of reusable widgets or components in web documents and web applications.<br>Web Components consist of 4 main elements which can be used separately or all together:</span></p><ul class="c18 lst-kix_ucxv06xdi15q-0 start"><li class="c1 c3"><span>Custom Elements</span></li><li class="c1 c3"><span>Shadow DOM</span></li><li class="c1 c3"><span>HTML Imports</span></li><li class="c1 c3"><span>HTML Templates</span></li></ul><h2 class="c28 c1"><a name="h.waf9mw9uy47v"></a><span class="c24 c20">Polymer </span></h2><p class="c1"><span>The Polymer library developed by Google is designed to make easier and faster for developers to create reusable components for the modern web.</span></p><p class="c1 c7"><span></span></p><h2 class="c28 c1"><a name="h.oylshnr4dqms"></a><span class="c24 c20">webcomponents.js polyfills</span></h2><p class="c1"><span>Are a set of polyfills built on top of the Web Components specifications. It makes possible for developers to use these standards today across all modern browsers. As these technologies are implemented in browsers, the polyfills will shrink and you&#39;ll gain the benefits of native implementations. webcomponents.js automatically detects native support and switches to the fast path when available. Your elements seamlessly start relying on the native implementation.</span></p><p class="c1 c7"><span class="c20"></span></p><h2 class="c28 c1"><a name="h.wtrwkodajjel"></a><span class="c24 c20">Datalet</span></h2><p class="c1"><span>It&lsquo;s responsible for data retrieving, filtering and visualization. From technological point of view it&rsquo;s a web component built with </span><span class="c16">polymer library</span><span>. In our architecture each Datalet inherit from a base web component: base-datalet. </span></p><p class="c1"><span>The base-datalet have two main attributes: data_url and query. The data_url attribute specify the data url from which to take data. This data should be json formatted and available by ajax request. The query attribute is a string which represent a selection and, optionally, filtering to apply to retrieved data. </span></p><p class="c1 c7"><span></span></p><h3 class="c19 c1 c10"><a name="h.oa5t1t1cc2mn"></a><span class="c26 c20">Datalet lifecycle</span></h3><p class="c1 c10 c7"><span class="c20"></span></p><p class="c1 c10"><span>Each Datalet follow this lifecycle inherit from base-datalet:</span></p><p class="c1 c10 c7"><span></span></p><ol class="c18 lst-kix_cktmoc41t532-0 start" start="1"><li class="c1 c11"><span>Data retrieving through an ajax request</span></li><li class="c1 c11"><span>Data selection </span></li><li class="c1 c11"><span>Data filtering (optional)</span></li><li class="c1 c11"><span>Data transformation </span></li><li class="c1 c11"><span>Data presentation</span></li></ol><p class="c1 c7"><span></span></p><p class="c1 c7"><span></span></p><p class="c1 c7"><span></span></p><p class="c1 c7"><span class="c20"></span></p><p class="c1 c7"><span class="c20"></span></p><h2 class="c28 c1"><a name="h.qor0wy2nd780"></a><span class="c20 c24">Controllet </span></h2><p class="c1"><span>It&rsquo;s a web component created with Polymer library that implements control behaviour like form, slider, etc. It generally use a set of polymer core elements to realize a more complex component using composition paradigm.</span></p><p class="c1 c7"><span class="c20"></span></p><h2 class="c28 c1"><a name="h.c8d89fu6xb9y"></a><span class="c24 c20">DatalEts Ecosystem Provider (DEEP)</span></h2><p class="c1"><span>The DatalEts Ecosystem Provider (DEEP) is a RESTful web service written in PHP. It make available a public discovery service that retrieve all the Datalet available into the system and a service call that provide a specific Datalet.</span></p><p class="c1 c7"><span></span></p><h2 class="c28 c1"><a name="h.juucc2j3piae"></a><span class="c24 c20">DEEPCLIENT</span></h2><p class="c1"><span>Is a simple javascript library that allows the connection with DEEP and the inclusion of a Datalet/Controllet within a HTML page.</span></p><p class="c1 c7"><span></span></p><h3 class="c19 c1"><a name="h.k19gs218be3l"></a><span class="c20 c26">DEEPCLIENT Usage: </span></h3><p class="c1 c7"><span></span></p><p class="c1"><span>This is a minimal example of deep client usage. </span></p><p class="c1 c7"><span class="c56 c20 c16"></span></p><p class="c1"><span class="c2 c8">&lt;html&gt;</span><span class="c2 c5"><br></span><span class="c2 c8">&lt;head&gt;</span></p><p class="c1"><span class="c2 c8">&lt;script</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">type</span><span class="c2 c4">=</span><span class="c2 c17">&quot;text/javascript&quot;</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">src</span><span class="c2 c4">=</span><span class="c2 c17">&quot;js/jquery-1.11.2.min.js&quot;</span><span class="c2 c8">&gt;&lt;/script&gt;</span><span class="c2 c5"><br></span><span class="c2 c8">&lt;script</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">type</span><span class="c2 c4">=</span><span class="c2 c17">&quot;text/javascript&quot;</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">src</span><span class="c2 c4">=</span><span class="c2 c17">&quot;js/webcomponents.js&quot;</span><span class="c2 c8">&gt;&lt;/script&gt;</span><span class="c2 c5"><br></span><span class="c2 c8">&lt;script</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">type</span><span class="c2 c4">=</span><span class="c2 c17">&quot;text/javascript&quot;</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">src</span><span class="c2 c4">=</span><span class="c2 c17">&quot;js/deepClient.js&quot;</span><span class="c2 c8">&gt;&lt;/script&gt;</span></p><p class="c1"><span class="c2 c5">&nbsp;</span><span class="c2 c8">&lt;script</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">type</span><span class="c2 c4">=</span><span class="c2 c17">&quot;text/javascript&quot;</span><span class="c2 c8">&gt;</span><span class="c2 c5"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;jQuery(document).ready(function($) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; var datalet_params =</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">{</span><span class="c2 c5"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;component &nbsp; </span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;DATALET_NAME&quot;</span><span class="c2 c4">, </span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; </span><span class="c2 c8">params</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">{</span><span class="c2 c5"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data</span><span class="c2 c4">-</span><span class="c2 c5">url &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;DATA_URL&quot;,</span></p><p class="c1 c10 c50"><span class="c2 c5">layou</span><span class="c2 c4">-</span><span class="c2 c5">param</span><span class="c2 c4">-</span><span class="c0">1</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;LAYOUT-VALUE&quot;,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; </span><span class="c2 c4">}</span><span class="c2 c5"><br> &nbsp; &nbsp; fields &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Array</span><span class="c2 c4">(</span><span class="c2 c17">&quot;FIELD1&quot;</span><span class="c2 c4">,</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;FIELD2&quot;</span><span class="c2 c4">),</span><span class="c2 c5"><br> &nbsp; &nbsp; placeHolder </span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;HTML_PLACEHOLDER&quot;</span></p><p class="c1"><span class="c2 c4">};</span></p><p class="c1"><span class="c2 c5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</span><span class="c2 c6">ComponentService</span><span class="c2 c4">.</span><span class="c2 c5">deep_url </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;DEEP_URL&#39;</span><span class="c2 c4">;</span><span class="c2 c5"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; </span><span class="c2 c6">ComponentService</span><span class="c2 c4">.</span><span class="c2 c5">getComponent</span><span class="c2 c4">(</span><span class="c2 c5">datalet_params</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2 c5"><br> &nbsp; &nbsp;</span><span class="c2 c4">});</span></p><p class="c1"><span class="c2 c5"><br> &nbsp;</span><span class="c2 c8">&lt;/script&gt;</span></p><p class="c1"><span class="c2 c8">&lt;/head&gt;</span></p><p class="c1"><span class="c2 c8">&lt;body&gt;</span></p><p class="c1"><span class="c2 c8">&lt;div</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">id</span><span class="c2 c4">=</span><span class="c2 c17">&quot;HTML_PLACEHOLDER&quot;</span><span class="c2 c8">&gt;&lt;/div&gt;</span></p><p class="c1"><span class="c2 c8">&lt;/body&gt;</span></p><p class="c1"><span class="c2 c8">&lt;/html&gt;</span></p><p class="c1 c7"><span class="c56 c16"></span></p><p class="c1 c7"><span></span></p><p class="c1"><span>We create an empty HTML document with a single DIV. On document ready event we create a datalet_params object, this object contains information for Datalet retrieving and initialization.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>datalet_params contains :</span></p><ul class="c18 lst-kix_iy595p3cktj3-0 start"><li class="c1 c3"><span class="c16">component :</span><span>&nbsp;the Datalet name to be sent to DEEP (Eg. </span><span class="c55">datatable-datalet</span><span>)</span></li><li class="c1 c3"><span class="c16">params.data-url (optional) :</span><span>&nbsp;the datasource URL (Eg.</span><span class="c43"><a class="c15" href="https://www.google.com/url?q=http://demo.ckan.org/api/action/datastore_search?resource_id%3D8324a4c9-66d6-47bf-a898-94237cc39b9f%26limit%3D50&amp;sa=D&amp;usg=AFQjCNGkCQWc7y9Rs22UreQdnCtpPZYVFw">http://demo.ckan.org/api/action/datastore_search?resource_id=8324a4c9-66d6-47bf-a898-94237cc39b9f&amp;limit=50</a></span><span>)</span></li><li class="c1 c3"><span class="c16">params.layout-params (optional)</span><span>: e.g. chart title, axis labels </span></li><li class="c1 c3"><span class="c16">fields :</span><span>&nbsp;an array with user selected fields from datasource (Eg. </span><span class="c69">Array</span><span class="c42">(</span><span class="c55">&quot;Supplier&quot;</span><span class="c42">, </span><span class="c55">&quot;Amount&quot;</span><span class="c42">)</span><span>)</span></li><li class="c1 c3"><span class="c16">placeHolder :</span><span>&nbsp;the ID of the DOM element where place the Datalet </span></li></ul><p class="c1 c7"><span></span></p><p class="c1"><span class="c42 c16">ComponentService.getComponent </span><span>function</span><span class="c42 c16">&nbsp;</span><span>take a datalet_params object as parameter. This function is responsible for Datalet info retrieving from DEPP and Datalet/Controllet code retrieving from DEEPCOMPONENTS. Once the Datalet/Controllet code is available DEEPCLIENT add the Datalet to the document DOM and initialize the Datalet with the </span><span class="c16">params </span><span>parameters. The Datalet/Controllet will use the fields data for the selection step.</span></p><p class="c1"><span>Now the Datalet is able to complete its lifecycle.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span>The programmer must specify the DEEP endpoint through the variable </span><span class="c42 c16">ComponentService.deep_url.</span><span><br></span><span>e.g.: ComponentService.deep_url = &#39;http://deep.routetopa.eu/DEEP/&#39;;</span></p><hr style="page-break-before:always;display:none;"><p class="c1 c7"><span></span></p><h1 class="c28 c1"><a name="h.pz7vvqc2atb"></a><span class="c59">Components Tutorial (Polymer 1.0)</span></h1><p class="c1"><span class="c20">[Knowledge required : javascript, html, Polymer 1.0]</span></p><p class="c1 c7"><span></span></p><h2 class="c28 c1"><a name="h.ig6fal8a8s2x"></a><span class="c24 c20">A behaviors based architecture </span></h2><p class="c1 c7"><span></span></p><p class="c1"><span>Since Polymer 1.0 doesn&rsquo;t support components inheritance, we provide a way to have it in datalets, waiting for it in the next Polymer version.</span></p><p class="c1"><span>We provide a bundle of objects that implements all behaviors we want our datalets have. They are divided in two categories : BaseDataletsBehaviors and CustomDataletBehaviors. </span></p><p class="c1"><span>The BaseDataletBehaviors define the lifecycle for all Datalets. Every lifecycle step in BaseDataletBehaviors &nbsp;is implemented in the CustomDataletBehaviors. This mechanism provides a components hierarchy that standardize Datalet production and make reusable common behaviors.</span></p><p class="c1"><span>&nbsp;</span></p><p class="c1"><span>The BaseDataletBehaviors are:</span></p><ul class="c18 lst-kix_caqenjpjbamt-0 start"><li class="c1 c3"><span>BaseDataletBehavior</span></li><li class="c1 c3"><span>WorkcycleBehavior</span></li></ul><p class="c1 c7"><span></span></p><p class="c1"><span>The BaseDataletBehavior define the mandatory attributes that all datalet must have :</span></p><p class="c1 c7"><span></span></p><ul class="c18 lst-kix_mwbvd56bd501-0 start"><li class="c1 c3"><span class="c16">data_url (string) : </span><span>the URL used to get the data from the Open Data Provider (e.g. the CKAN API).</span></li><li class="c1 c3"><span class="c16">fields (String)</span><span>: it represents a JSON array of user selected dataset fields.</span></li><li class="c1 c3"><span class="c16">data (array): </span><span>&nbsp;data structure that store the data retrieved from Open Data Provider.</span></li></ul><p class="c1 c7"><span></span></p><p class="c1"><span class="c2 c8">var</span><span class="c2">&nbsp;</span><span class="c2 c6">BaseDataletBehavior</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;{</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;properties</span><span class="c2 c4">:</span><span class="c2">&nbsp;{</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">It</span><span class="c2">&nbsp;represent the data url </span><span class="c2 c8">from</span><span class="c2">&nbsp;CKAN api</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@attribute</span><span class="c2">&nbsp;dataUrl</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@type</span><span class="c2">&nbsp;</span><span class="c2 c8">string</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@default</span><span class="c2">&nbsp;</span><span class="c2 c17">&#39;null&#39;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;dataUrl</span><span class="c2 c4">:</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c6">String,</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c17">&quot;&quot;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">It</span><span class="c2">&nbsp;represents one </span><span class="c2 c8">or</span><span class="c2">&nbsp;multiple fields selected </span><span class="c2 c8">by</span><span class="c2">&nbsp;user</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@attribute</span><span class="c2">&nbsp;fields</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@type</span><span class="c2">&nbsp;</span><span class="c2 c6">String</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@default</span><span class="c2">&nbsp;empty</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;fields</span><span class="c2 c4">:</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c6">String,</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c17">&quot;&quot;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">The</span><span class="c2">&nbsp;selected </span><span class="c2 c8">and</span><span class="c2">&nbsp;transformed data you can </span><span class="c2 c8">use</span><span class="c2">&nbsp;</span><span class="c2 c8">in</span><span class="c2">&nbsp;presentation phase</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@attribute</span><span class="c2">&nbsp;data</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@type</span><span class="c2">&nbsp;</span><span class="c2 c6">Array</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@default</span><span class="c2">&nbsp;empty</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;data</span><span class="c2 c4">:</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c6">Array,</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c4">[]</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;factoryImpl</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(</span><span class="c2">data_url</span><span class="c2 c4">,</span><span class="c2">&nbsp;fields</span><span class="c2 c4">)</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">data_url </span><span class="c2 c4">=</span><span class="c2">&nbsp;data_url;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">fields &nbsp; </span><span class="c2 c4">=</span><span class="c2">&nbsp;fields;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;}</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2 c4">};</span></p><p class="c1 c7"><span class="c22 c20"></span></p><p class="c1 c7"><span></span></p><p class="c1 c7"><span></span></p><p class="c1"><span>The WorkcycleBehavior implements the workcycle of each datalets, composed by this steps :</span></p><p class="c1 c7"><span></span></p><ul class="c18 lst-kix_oldlfkxmjbuj-0 start"><li class="c1 c3"><span class="c16">Get the data</span><span>&nbsp;</span><span class="c16">from a source</span><span>&nbsp;: It&rsquo;s responsible for data retrieving from an Open Data Platform. It&rsquo;s the starting point of Datalet work-cycle.</span></li><li class="c1 c3"><span class="c16">Select a subset of fields from the data</span><span>&nbsp;: this operation is data format dependent. It&rsquo;s responsible for extract a query related subset of information from the entire dataset. An multidimensional array will be made available for the transformation step.</span></li><li class="c1 c3"><span class="c16">Filter </span><span>the data by applying logical operation( &lt;, &gt;, =, &lt;=, &gt;=, etc.): this function is designed to apply logical operation to the data created in the selection step (this step and the previous one could be merged together).</span></li><li class="c1 c3"><span class="c16">Transform </span><span>data in order to obtain a coherent data rapresentation</span></li><li class="c1 c3"><span class="c16">Present data </span><span>the data for a specific visualization : here we create the data structure necessary for visualization libraries initialization. At this point could be an interaction with component&rsquo;s DOM. &nbsp; &nbsp; </span></li></ul><p class="c1 c7"><span></span></p><p class="c1"><span class="c2 c8">var</span><span class="c2">&nbsp;</span><span class="c2 c6">WorkcycleBehavior</span><span class="c2">&nbsp;</span><span class="c2 c4">=</span><span class="c2">&nbsp;{</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;_component</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">null,</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">Request</span><span class="c2">&nbsp;data </span><span class="c2 c8">from</span><span class="c2">&nbsp;source</span><span class="c2 c4">(</span><span class="c2">e</span><span class="c2 c4">.</span><span class="c2">g</span><span class="c2 c4">.</span><span class="c2">&nbsp;CKAN </span><span class="c2 c8">by</span><span class="c2">&nbsp;api</span><span class="c2 c4">)</span><span class="c2">&nbsp;</span><span class="c2 c8">using</span><span class="c2">&nbsp;some kind of technology</span><span class="c2 c4">(</span><span class="c2">e</span><span class="c2 c4">.</span><span class="c2">g</span><span class="c2 c4">.</span><span class="c2">&nbsp;</span><span class="c2 c6">Ajax)</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;requestData</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;requestData</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">Select</span><span class="c2">&nbsp;the fields </span><span class="c2 c8">from</span><span class="c2">&nbsp;data</span><span class="c2 c4">(</span><span class="c2">typically json</span><span class="c2 c4">)</span><span class="c2">&nbsp;previously retrieved </span><span class="c2 c8">by</span><span class="c2">&nbsp;ajax request</span><span class="c2 c4">.</span><span class="c2">&nbsp;</span><span class="c2 c6">The</span><span class="c2">&nbsp;selection could be </span><span class="c2 c8">done</span><span class="c2">&nbsp;</span><span class="c2 c8">by</span><span class="c2">&nbsp;jsonPath but</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;it depends on the representation data format</span><span class="c2 c4">(</span><span class="c2">CKAN apies </span><span class="c2 c8">return</span><span class="c2">&nbsp;a json representation of the dataset</span><span class="c2 c4">).</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;selectData</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;selectData</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">Filter</span><span class="c2">&nbsp;data previously selected</span><span class="c2 c4">.</span><span class="c2">&nbsp;</span><span class="c2 c6">An</span><span class="c2">&nbsp;example of filterting could be an expression such </span><span class="c2 c17">&quot;fields &gt; 30&quot;</span><span class="c2">&nbsp;</span><span class="c2 c8">or</span><span class="c2">&nbsp;</span><span class="c2 c17">&quot;fields = &#39;AAA&#39;&quot;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">If</span><span class="c2">&nbsp;you are </span><span class="c2 c8">using</span><span class="c2">&nbsp;jsonPath to </span><span class="c2 c8">select</span><span class="c2">&nbsp;the datas you can apply an expression directly </span><span class="c2 c8">in</span><span class="c2">&nbsp;the jsonPath query </span><span class="c2 c8">string.</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;filterData</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;filterData</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">Transform</span><span class="c2">&nbsp;the selected data </span><span class="c2 c8">in</span><span class="c2">&nbsp;order to build the structure that the presentation phase needs.</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;transformData</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;transformData</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">Build</span><span class="c2">&nbsp;the </span><span class="c2 c8">object</span><span class="c2 c4">/</span><span class="c2">s </span><span class="c2 c8">for</span><span class="c2">&nbsp;presentation layer.</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;presentData</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;presentData</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">This</span><span class="c2">&nbsp;method represents the entire datalet workcycle.</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;runWorkcycle</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;runWorkcycle</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">()</span><span class="c2">&nbsp;{</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">selectData</span><span class="c2 c4">();</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">filterData</span><span class="c2 c4">();</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">transformData</span><span class="c2 c4">();</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">presentData</span><span class="c2 c4">();</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c2 c6">This</span><span class="c2">&nbsp;method save the reference to the polymer </span><span class="c2 c8">object</span><span class="c2">&nbsp;related to the datalet.</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2">&nbsp;</span><span class="c0">@method</span><span class="c2">&nbsp;init</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;init</span><span class="c2 c4">:</span><span class="c2">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(</span><span class="c2">component</span><span class="c2 c4">){</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">_component </span><span class="c2 c4">=</span><span class="c2">&nbsp;component;</span></p><p class="c1"><span class="c2">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2">requestData</span><span class="c2 c4">();</span></p><p class="c1"><span class="c2">&nbsp; &nbsp;}</span></p><p class="c1 c7"><span class="c2"></span></p><p class="c1"><span class="c2 c4">};</span></p><p class="c1 c7"><span class="c20 c22"></span></p><p class="c1"><span>&nbsp;</span></p><p class="c1"><span>The </span><span class="c16">CustomDataletBehaviors </span><span>represents the specific implementation for the work-cycle steps. </span></p><p class="c1"><span>This behaviours are a components hierarchy that use a particular communication channel, data format and visualization library.</span></p><h2 class="c28 c1"><a name="h.23494m888vls"></a><span class="c24 c20">An example of datalet for Highchart js library</span></h2><p class="c1 c7"><span></span></p><p class="c1"><span>We&rsquo;ll describe for example purpose a Datalet that use a AJAX channal, handle JSON data format and use Highcharts for data visualization and JSONPATH library for data selection.</span></p><p class="c1 c7"><span></span></p><h3 class="c1 c19"><a name="h.qqdl4o86ucxr"></a><span class="c26 c20">Ajax-Json-JsonPath behavior</span></h3><p class="c1 c7"><span></span></p><p class="c1"><span>Here we exploit an AJAX communication channel that handle JSON data format and extends the base behaviors (in particular the requestData method). This behavior override the </span><span class="c16">select </span><span>method in order to perform a JSONPATH query according to the user selected fields stored in the </span><span class="c16">this._component.fields </span><span>variable.</span></p><p class="c1 c7"><span></span></p><p class="c1"><span class="c2 c8">var</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">AjaxJsonJsonPathBehavior</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;{</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;properties</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">It</span><span class="c2 c5">&nbsp;contains the json data </span><span class="c2 c8">from</span><span class="c2 c5">&nbsp;async xhr call returned </span><span class="c2 c8">from</span><span class="c2 c5">&nbsp;core</span><span class="c2 c4">-</span><span class="c2 c5">ajax core component</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@attribute</span><span class="c2 c5">&nbsp;json_results</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@type</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">object</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@default</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&#39;null&#39;.</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;json_results</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Object,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">{}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Make</span><span class="c2 c5">&nbsp;an AJAX call to the dataset URL</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@method</span><span class="c2 c5">&nbsp;requestData</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;requestData</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;comp </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this;</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;$</span><span class="c2 c4">.</span><span class="c2 c5">ajax</span><span class="c2 c4">({</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;url</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">dataUrl,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dataType</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;json&quot;,</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;success</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(</span><span class="c2 c5">e</span><span class="c2 c4">){</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;comp</span><span class="c2 c4">.</span><span class="c2 c5">handleResponse</span><span class="c2 c4">(</span><span class="c2 c5">e</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c4">});</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Called</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">when</span><span class="c2 c5">&nbsp;core</span><span class="c2 c4">-</span><span class="c2 c5">ajax component receive the json data </span><span class="c2 c8">from</span><span class="c2 c5">&nbsp;called url.</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@method</span><span class="c2 c5">&nbsp;handleResponse</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;handleResponse</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(</span><span class="c2 c5">e</span><span class="c2 c4">)</span><span class="c2 c5">&nbsp;{</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">properties</span><span class="c2 c4">.</span><span class="c2 c5">json_results</span><span class="c2 c4">.</span><span class="c2 c5">value </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;e;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">runWorkcycle</span><span class="c2 c4">();</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Check</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">if</span><span class="c2 c5">&nbsp;input field</span><span class="c2 c4">(</span><span class="c2 c5">passed </span><span class="c2 c8">as</span><span class="c2 c5">&nbsp;an array of separated value that mach </span><span class="c2 c8">with</span><span class="c2 c5">&nbsp;field path </span><span class="c2 c8">in</span><span class="c2 c5">&nbsp;received </span><span class="c2 c8">object</span><span class="c2 c4">)</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">is</span><span class="c2 c5">&nbsp;an array of objet.</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">The</span><span class="c2 c5">&nbsp;field </span><span class="c2 c8">is</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">checked</span><span class="c2 c5">&nbsp;on current json </span><span class="c2 c8">object</span><span class="c2 c5">&nbsp;retrieved </span><span class="c2 c8">from</span><span class="c2 c5">&nbsp;the async request.</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@param</span><span class="c2 c5">&nbsp;field</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;isFieldArray </span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(</span><span class="c2 c5">field</span><span class="c2 c4">){</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; </span><span class="c2 c8">if</span><span class="c2 c4">(</span><span class="c2 c5">field</span><span class="c2 c4">.</span><span class="c2 c5">length </span><span class="c2 c4">==</span><span class="c2 c5">&nbsp;</span><span class="c0">0</span><span class="c2 c4">)</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">return</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">false;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; </span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;obj </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">properties</span><span class="c2 c4">.</span><span class="c2 c5">json_results</span><span class="c2 c4">.</span><span class="c2 c5">value</span><span class="c2 c4">[</span><span class="c2 c5">field</span><span class="c2 c4">[</span><span class="c0">0</span><span class="c2 c4">]];</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; </span><span class="c2 c8">for</span><span class="c2 c4">(</span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;i</span><span class="c2 c4">=</span><span class="c0">1</span><span class="c2 c4">;</span><span class="c2 c5">&nbsp;i </span><span class="c2 c4">&lt;</span><span class="c2 c5">&nbsp;field</span><span class="c2 c4">.</span><span class="c2 c5">length</span><span class="c2 c4">;</span><span class="c2 c5">&nbsp;i</span><span class="c2 c4">++){</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;obj </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">(</span><span class="c2 c5">obj</span><span class="c2 c4">.</span><span class="c2 c5">constructor </span><span class="c2 c4">==</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Array</span><span class="c2 c4">)</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">?</span><span class="c2 c5">&nbsp;obj</span><span class="c2 c4">[</span><span class="c0">0</span><span class="c2 c4">][</span><span class="c2 c5">field</span><span class="c2 c4">[</span><span class="c2 c5">i</span><span class="c2 c4">]]</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;obj</span><span class="c2 c4">[</span><span class="c2 c5">field</span><span class="c2 c4">[</span><span class="c2 c5">i</span><span class="c2 c4">]];</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; }</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; </span><span class="c2 c8">return</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">(</span><span class="c2 c5">obj</span><span class="c2 c4">.</span><span class="c2 c5">constructor </span><span class="c2 c4">===</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Array</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">&amp;&amp;</span><span class="c2 c5">&nbsp;obj</span><span class="c2 c4">[</span><span class="c0">0</span><span class="c2 c4">].</span><span class="c2 c5">constructor </span><span class="c2 c4">==</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">Object</span><span class="c2 c4">)</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">?</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">true</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">false;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c4">},</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;</span><span class="c2 c9">/**</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;selectData built a JSONPATH query based on the user selected fields </span><span class="c2 c8">then</span><span class="c2 c5">&nbsp;extract data </span><span class="c2 c8">from</span><span class="c2 c5">&nbsp;the JSON response.</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c2 c6">This</span><span class="c2 c5">&nbsp;method built an objects </span><span class="c2 c4">&lt;</span><span class="c2 c5">name</span><span class="c2 c4">,</span><span class="c2 c5">&nbsp;data</span><span class="c2 c4">&gt;</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">for</span><span class="c2 c5">&nbsp;every user selected field </span><span class="c2 c8">and</span><span class="c2 c5">&nbsp;push it </span><span class="c2 c8">into</span><span class="c2 c5">&nbsp;the data array.</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; *</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*</span><span class="c2 c5">&nbsp;</span><span class="c0">@method</span><span class="c2 c5">&nbsp;selectData</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; </span><span class="c2 c4">*/</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp;selectData </span><span class="c2 c4">:</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">function</span><span class="c2 c4">(){</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">data </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">[];</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">fields </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;JSON</span><span class="c2 c4">.</span><span class="c2 c5">parse</span><span class="c2 c4">(</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">fields</span><span class="c2 c4">);</span></p><p class="c1 c7"><span class="c2 c5"></span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">for</span><span class="c2 c4">(</span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;i</span><span class="c2 c4">=</span><span class="c0">0</span><span class="c2 c4">;</span><span class="c2 c5">i </span><span class="c2 c4">&lt;</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">fields</span><span class="c2 c4">.</span><span class="c2 c5">length</span><span class="c2 c4">;</span><span class="c2 c5">&nbsp;i</span><span class="c2 c4">++){</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;query </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;$&quot;;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;query_elements </span><span class="c2 c4">=</span><span class="c2 c5">&nbsp;</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">_component</span><span class="c2 c4">.</span><span class="c2 c5">fields</span><span class="c2 c4">[</span><span class="c2 c5">i</span><span class="c2 c4">].</span><span class="c2 c5">split</span><span class="c2 c4">(</span><span class="c2 c17">&#39;,&#39;</span><span class="c2 c4">);</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">for</span><span class="c2 c4">(</span><span class="c2 c8">var</span><span class="c2 c5">&nbsp;j</span><span class="c2 c4">=</span><span class="c0">0</span><span class="c2 c4">;</span><span class="c2 c5">&nbsp;j </span><span class="c2 c4">&lt;</span><span class="c2 c5">&nbsp;query_elements</span><span class="c2 c4">.</span><span class="c2 c5">length</span><span class="c2 c4">;</span><span class="c2 c5">j</span><span class="c2 c4">++){</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;query </span><span class="c2 c4">+=</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;[&#39;&quot;</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">+</span><span class="c2 c5">&nbsp;query_elements</span><span class="c2 c4">[</span><span class="c2 c5">j</span><span class="c2 c4">]</span><span class="c2 c5">&nbsp;</span><span class="c2 c4">+</span><span class="c2 c5">&nbsp;</span><span class="c2 c17">&quot;&#39;]&quot;;</span></p><p class="c1"><span class="c2 c5">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="c2 c8">if</span><span class="c2 c4">(</span><span class="c2 c8">this</span><span class="c2 c4">.</span><span class="c2 c5">isFieldArray</span><span class="c2 c4">(</span><span class="c2 c5">query_elements</span><span class="c2 c4">.</span><span class="c2 c5">slice</span><span class="c2 c4">(</span><span class="c0">0</span><span class="c2 c4">,</span><span class="c2 c5">j</span>&