1 | <?xml version="1.0" encoding="ISO-8859-1"?> |
---|
2 | |
---|
3 | <xsl:stylesheet version="3.0" |
---|
4 | xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" |
---|
5 | xmlns:xs ="http://www.w3.org/2001/XMLSchema" |
---|
6 | xmlns:ibis="http://www.ibisph.org" |
---|
7 | |
---|
8 | exclude-result-prefixes="ibis xs xsl" |
---|
9 | > |
---|
10 | <xsl:import href="../Page.xslt"/> |
---|
11 | <xsl:import href="../../../Kendo.xslt"/> |
---|
12 | <xsl:import href="../../../LeafletMap.xslt"/> |
---|
13 | <xsl:import href="../Indicator.xslt"/> |
---|
14 | <xsl:import href="../Interactive.xslt"/> |
---|
15 | |
---|
16 | |
---|
17 | <ibis:doc> |
---|
18 | <name>html/indicator/profile/view/Page</name> |
---|
19 | <summary>Interactive indicator profile view page</summary> |
---|
20 | <description> |
---|
21 | Specific XSLT used to create the indicator profile view page. |
---|
22 | </description> |
---|
23 | </ibis:doc> |
---|
24 | |
---|
25 | |
---|
26 | <xsl:param name="Page.pageTitle" ibis:doc="Page's title text based on the 'INDICATOR/TITLE' element."> |
---|
27 | Health Indicator Report - <xsl:value-of select="$indicator/TITLE"/> |
---|
28 | </xsl:param> |
---|
29 | <xsl:param name="Page.sectionsTitle" ibis:doc="Page's content block title text based on the 'INDICATOR/TITLE' element."> |
---|
30 | Health Indicator Report of <xsl:value-of select="$indicator/TITLE"/> |
---|
31 | </xsl:param> |
---|
32 | |
---|
33 | <xsl:param name="Indicator.contentBlockType" select="'fixed'"/> |
---|
34 | <xsl:param name="Indicator.contentBlockTitleLevel" select="3"/> |
---|
35 | |
---|
36 | |
---|
37 | <xsl:template name="Page.sectionsContent" |
---|
38 | ibis:doc="Main page content template that determines if IP or Surrogate." |
---|
39 | > |
---|
40 | <xsl:if test="0 = string-length($indicatorView/SURROGATE_VIEW_URL)"> |
---|
41 | <xsl:call-template name="Page.interativeContent"> |
---|
42 | <xsl:with-param name="indicatorView" select="$indicatorView"/> |
---|
43 | </xsl:call-template> |
---|
44 | </xsl:if> |
---|
45 | |
---|
46 | <xsl:if test="0 != string-length($indicatorView/SURROGATE_VIEW_URL)"> |
---|
47 | <xsl:call-template name="Page.insertAJAXContent"> |
---|
48 | <xsl:with-param name="sourceContentURL" select="$indicatorView/SURROGATE_VIEW_URL"/> |
---|
49 | </xsl:call-template> |
---|
50 | </xsl:if> |
---|
51 | </xsl:template> |
---|
52 | |
---|
53 | |
---|
54 | <xsl:template name="Page.interativeContent" |
---|
55 | ibis:doc="Main interactive sections content template." |
---|
56 | > |
---|
57 | <xsl:param name="indicatorView"/> |
---|
58 | |
---|
59 | <xsl:call-template name="ContentContainer.expandable"> |
---|
60 | <xsl:with-param name="title" select="'Why Is This Important?'"/> |
---|
61 | <xsl:with-param name="content" select="$indicator/WHY_IMPORTANT"/> |
---|
62 | <xsl:with-param name="description" select="'Text that describes why this indicator is important to the populations overall health'"/> |
---|
63 | <xsl:with-param name="show" select="true()"/> |
---|
64 | <xsl:with-param name="additionalClasses" select="'Text'"/> |
---|
65 | <xsl:with-param name="addWikiAttribute" select="true()"/> |
---|
66 | </xsl:call-template> |
---|
67 | |
---|
68 | <xsl:if test="ibis:LeafletMap.showMap($indicatorView/MAP_NAME)"> |
---|
69 | <xsl:call-template name="ContentContainer.expandable"> |
---|
70 | <xsl:with-param name="title" select="'Map'"/> |
---|
71 | <xsl:with-param name="content"> |
---|
72 | <xsl:call-template name="LeafletMap.mapContainer"> |
---|
73 | <xsl:with-param name="containerID" select="'map'"/> |
---|
74 | <xsl:with-param name="title" select="ibis:getMapTitle($indicator, $indicatorView)"/> |
---|
75 | </xsl:call-template> |
---|
76 | <xsl:call-template name="Indicator.contentBlock"> |
---|
77 | <xsl:with-param name="content" select="$indicatorView/MAP_NARRATIVE"/> |
---|
78 | <xsl:with-param name="contentBlockType" select="'fixed'" tunnel="yes"/> |
---|
79 | </xsl:call-template> |
---|
80 | </xsl:with-param> |
---|
81 | <xsl:with-param name="show" select="true()"/> |
---|
82 | <xsl:with-param name="addWikiAttribute" select="false()"/> |
---|
83 | <xsl:with-param name="description" select="'Choropleth/thematic map.'"/> |
---|
84 | </xsl:call-template> |
---|
85 | </xsl:if> |
---|
86 | |
---|
87 | <xsl:if test="ibis:Kendo.showChart($indicatorView/CHART_NAME)"> |
---|
88 | <xsl:call-template name="ContentContainer.expandable"> |
---|
89 | <xsl:with-param name="title" select="'Chart'"/> |
---|
90 | <xsl:with-param name="content"> |
---|
91 | <xsl:call-template name="Kendo.chartContainer"> |
---|
92 | <xsl:with-param name="containerID" select="'chart'"/> |
---|
93 | <xsl:with-param name="title" select="ibis:getChartTitle($indicator, $indicatorView)"/> |
---|
94 | </xsl:call-template> |
---|
95 | <xsl:call-template name="Indicator.contentBlock"> |
---|
96 | <xsl:with-param name="content" select="$indicatorView/CHART_NARRATIVE"/> |
---|
97 | <xsl:with-param name="contentBlockType" select="'fixed'" tunnel="yes"/> |
---|
98 | </xsl:call-template> |
---|
99 | |
---|
100 | </xsl:with-param> |
---|
101 | <xsl:with-param name="show" select="true()"/> |
---|
102 | <xsl:with-param name="addWikiAttribute" select="false()"/> |
---|
103 | </xsl:call-template> |
---|
104 | </xsl:if> |
---|
105 | |
---|
106 | <xsl:call-template name="ContentContainer.expandable"> |
---|
107 | <xsl:with-param name="title" select="'Supplemental Graphic'"/> |
---|
108 | <xsl:with-param name="content"> |
---|
109 | <xsl:call-template name="Indicator.supplementalImage"> |
---|
110 | <xsl:with-param name="indicatorView" select="$indicatorView"/> |
---|
111 | </xsl:call-template> |
---|
112 | </xsl:with-param> |
---|
113 | <xsl:with-param name="show" select="true()"/> |
---|
114 | <xsl:with-param name="addWikiAttribute" select="false()"/> |
---|
115 | </xsl:call-template> |
---|
116 | |
---|
117 | <xsl:call-template name="ContentContainer.expandable"> |
---|
118 | <xsl:with-param name="title" select="'Data Table'"/> |
---|
119 | <xsl:with-param name="content"> |
---|
120 | <div class="Graphic Grid ScrollableContainer"> |
---|
121 | <div id="grid"></div> |
---|
122 | <br/><br/> |
---|
123 | GARTH TODO: Data table footnote needs to include the VALUE ATTRIBUTE codes and titles. |
---|
124 | <br/><br/> |
---|
125 | |
---|
126 | </div> |
---|
127 | </xsl:with-param> |
---|
128 | <xsl:with-param name="show" select="true()"/> |
---|
129 | <xsl:with-param name="addWikiAttribute" select="false()"/> |
---|
130 | </xsl:call-template> |
---|
131 | |
---|
132 | <xsl:call-template name="ContentContainer.expandable"> |
---|
133 | <xsl:with-param name="title" select="'Data Notes'"/> |
---|
134 | <xsl:with-param name="content"> |
---|
135 | <xsl:call-template name="Indicator.dataNotes"> |
---|
136 | <xsl:with-param name="title" select="'Notes'"/> |
---|
137 | <xsl:with-param name="indicator" select="$indicator"/> |
---|
138 | </xsl:call-template> |
---|
139 | |
---|
140 | <xsl:call-template name="Indicator.dataSources"> |
---|
141 | <xsl:with-param name="indicator" select="$indicator"/> |
---|
142 | <xsl:with-param name="indicatorView" select="$indicatorView"/> |
---|
143 | </xsl:call-template> |
---|
144 | |
---|
145 | <xsl:call-template name="Indicator.dataIssues"> |
---|
146 | <xsl:with-param name="indicator" select="$indicator"/> |
---|
147 | <xsl:with-param name="indicatorView" select="$indicatorView"/> |
---|
148 | </xsl:call-template> |
---|
149 | </xsl:with-param> |
---|
150 | <xsl:with-param name="show" select="true()"/> |
---|
151 | <xsl:with-param name="description" select="'Metadata for this health indicator.'"/> |
---|
152 | </xsl:call-template> |
---|
153 | |
---|
154 | <xsl:call-template name="ContentContainer.expandable"> |
---|
155 | <xsl:with-param name="title" select="'Other Views'"/> |
---|
156 | <xsl:with-param name="content"> |
---|
157 | This is possibly a left nav list??? |
---|
158 | <xsl:variable name="currentIndicatorViewName" select="$indicatorView/NAME"/> |
---|
159 | <xsl:variable name="indicatorViews" select="if(string-length($currentIndicatorViewName) != 0) then $indicator/INDICATOR_VIEWS/INDICATOR_VIEW[NAME != $currentIndicatorViewName] else $indicator/INDICATOR_VIEWS/INDICATOR_VIEW"/> |
---|
160 | <xsl:if test="exists($indicatorViews[1]/NAME)"> |
---|
161 | <ul> |
---|
162 | <xsl:for-each select="$indicatorViews"> |
---|
163 | <xsl:variable name="indicatorViewTitle" select="ibis:getPartialIndicatorViewTitle(current())"/> |
---|
164 | <li><a href="{concat($Indicator.viewURLPrefix, NAME, '.html')}" |
---|
165 | title="Another view for {$indicatorViewTitle}" |
---|
166 | ><xsl:value-of select="$indicatorViewTitle"/> |
---|
167 | </a></li> |
---|
168 | </xsl:for-each> |
---|
169 | </ul> |
---|
170 | </xsl:if> |
---|
171 | </xsl:with-param> |
---|
172 | </xsl:call-template> |
---|
173 | |
---|
174 | <xsl:call-template name="ContentContainer.expandable"> |
---|
175 | <xsl:with-param name="title" select="'Health Indicator Definition'"/> |
---|
176 | <xsl:with-param name="content"> |
---|
177 | <xsl:call-template name="Indicator.definition"/> |
---|
178 | <xsl:call-template name="Indicator.numerator"/> |
---|
179 | <xsl:call-template name="Indicator.denominator"/> |
---|
180 | </xsl:with-param> |
---|
181 | <xsl:with-param name="description" select="'What defines this health indicator.'"/> |
---|
182 | </xsl:call-template> |
---|
183 | |
---|
184 | <xsl:call-template name="ContentContainer.expandable"> |
---|
185 | <xsl:with-param name="title" select="'Health Objectives and Targets'"/> |
---|
186 | <xsl:with-param name="content"> |
---|
187 | <xsl:call-template name="Indicator.initiatives"/> |
---|
188 | <xsl:call-template name="Indicator.otherObjectives"/> |
---|
189 | </xsl:with-param> |
---|
190 | <xsl:with-param name="description" select="'Goals and objectives for this health indicator.'"/> |
---|
191 | </xsl:call-template> |
---|
192 | |
---|
193 | <xsl:call-template name="ContentContainer.expandable"> |
---|
194 | <xsl:with-param name="title" select="'Current Outlook'"/> |
---|
195 | <xsl:with-param name="content"> |
---|
196 | <xsl:call-template name="Indicator.howDoing"/> |
---|
197 | <xsl:call-template name="Indicator.howCompare"/> |
---|
198 | </xsl:with-param> |
---|
199 | <xsl:with-param name="description" select="'How are we doing, how do we compare.'"/> |
---|
200 | </xsl:call-template> |
---|
201 | |
---|
202 | <xsl:call-template name="ContentContainer.expandable"> |
---|
203 | <xsl:with-param name="title" select="'Health Improvement Resources'"/> |
---|
204 | <xsl:with-param name="content"> |
---|
205 | <xsl:call-template name="Indicator.whatDoing"/> |
---|
206 | <xsl:call-template name="Indicator.evidenceBasedPractices"/> |
---|
207 | <xsl:call-template name="Indicator.availableServices"/> |
---|
208 | <xsl:call-template name="Indicator.moreResources"/> |
---|
209 | <xsl:call-template name="Indicator.otherInformation"/> |
---|
210 | <xsl:call-template name="Indicator.footnoteReferences"/> |
---|
211 | </xsl:with-param> |
---|
212 | <xsl:with-param name="description" select="'Other related information and resources.'"/> |
---|
213 | </xsl:call-template> |
---|
214 | |
---|
215 | <xsl:call-template name="ContentContainer.expandable"> |
---|
216 | <xsl:with-param name="title" select="'Health Topics'"/> |
---|
217 | <xsl:with-param name="content"> |
---|
218 | another set of links that could be left nav |
---|
219 | <xsl:call-template name="Indicator.topics"> |
---|
220 | <xsl:with-param name="indicator" select="$indicator"/> |
---|
221 | </xsl:call-template> |
---|
222 | </xsl:with-param> |
---|
223 | </xsl:call-template> |
---|
224 | |
---|
225 | <xsl:call-template name="Indicator.allDates"/> |
---|
226 | |
---|
227 | <xsl:call-template name="Page.leafletKendoScript"> |
---|
228 | <xsl:with-param name="indicatorView" select="$indicatorView"/> |
---|
229 | </xsl:call-template> |
---|
230 | </xsl:template> |
---|
231 | |
---|
232 | |
---|
233 | |
---|
234 | <xsl:template name="Page.leafletKendoScript" |
---|
235 | ibis:doc="Provides the kendo and leaflet javascript." |
---|
236 | > |
---|
237 | <xsl:param name="indicatorView"/> |
---|
238 | |
---|
239 | <xsl:if test="ibis:LeafletMap.showMap($indicatorView/MAP_NAME)"> |
---|
240 | <xsl:call-template name="LeafletMap.choroplethJavaScript"/> |
---|
241 | </xsl:if> |
---|
242 | <xsl:variable name="measureName" select="$indicatorView/MEASURE_NAME"/> |
---|
243 | <xsl:variable name="measure" select="($indicator//MEASURE[NAME = $measureName])[1]"/> |
---|
244 | <xsl:variable name="measureValueFormatPattern" select="($indicator//VALUE_TYPE[NAME = $measure/VALUE_TYPE_NAME]/XSLT_FORMAT_PATTERN)[1]"/> |
---|
245 | |
---|
246 | <xsl:variable name="recordDimensionFields"> |
---|
247 | <xsl:call-template name="Interactive.recordDimensionFields"> |
---|
248 | <xsl:with-param name="indicatorView" select="$indicatorView"/> |
---|
249 | </xsl:call-template> |
---|
250 | </xsl:variable> |
---|
251 | |
---|
252 | <xsl:variable name="ancillaryValueNames" select="distinct-values($indicator/DATASETS/DATASET[NAME = $indicatorView/DATASET_NAMES/DATASET_NAME]/ANCILLARY_VALUES/ANCILLARY_VALUE/NAME)"/> |
---|
253 | <xsl:variable name="recordAncillaryValueFields"> |
---|
254 | <xsl:call-template name="Interactive.recordAncillaryValueFields"> |
---|
255 | <xsl:with-param name="indicator" select="$indicator"/> |
---|
256 | <xsl:with-param name="indicatorView" select="$indicatorView"/> |
---|
257 | <xsl:with-param name="ancillaryValueNames" select="$ancillaryValueNames"/> |
---|
258 | <xsl:with-param name="measureValueFormatPattern" select="$measureValueFormatPattern"/> |
---|
259 | </xsl:call-template> |
---|
260 | </xsl:variable> |
---|
261 | |
---|
262 | <xsl:variable name="datasetRecords" select="$indicator/DATASETS/DATASET[NAME = $indicatorView/DATASET_NAMES/DATASET_NAME]/RECORDS/RECORD"/> |
---|
263 | <xsl:variable name="indicatorViewDatasetRecords"> |
---|
264 | <xsl:call-template name="Interactive.indicatorViewDatasetRecords"> |
---|
265 | <xsl:with-param name="indicatorView" select="$indicatorView"/> |
---|
266 | <xsl:with-param name="datasetRecords" select="$datasetRecords"/> |
---|
267 | <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> |
---|
268 | </xsl:call-template> |
---|
269 | </xsl:variable> |
---|
270 | |
---|
271 | <!-- |
---|
272 | <xsl:message select="'============= start of IV datasetRecords'"/> |
---|
273 | <xsl:message select="$datasetRecords"/> |
---|
274 | <xsl:message select="'============= end of IV datasetRecords'"/> |
---|
275 | --> |
---|
276 | |
---|
277 | <!-- tried doing jsonp tech but callback func must be defined before doing the script jsonp |
---|
278 | so you'd have the variable = null, call back, end of script, include jsonp, then contructor |
---|
279 | script. Very messy - decided just to do simple var and include it. |
---|
280 | --> |
---|
281 | <script type="text/javascript"> |
---|
282 | var records = |
---|
283 | [<xsl:text> </xsl:text> |
---|
284 | <xsl:call-template name="Interactive.getIndicatorViewJSONDataRecords"> |
---|
285 | <xsl:with-param name="datasetRecords" select="$indicatorViewDatasetRecords"/> |
---|
286 | <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> |
---|
287 | <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> |
---|
288 | <xsl:with-param name="measureValueFormatPattern" select="$measureValueFormatPattern"/> |
---|
289 | </xsl:call-template> |
---|
290 | ]; |
---|
291 | |
---|
292 | var kendoDataSource = new kendo.data.DataSource( |
---|
293 | <xsl:call-template name="Kendo.dataSourceConstructorJSON"> |
---|
294 | <xsl:with-param name="javascriptRecordArrayVariableName" select="'records'"/> |
---|
295 | <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> |
---|
296 | <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> |
---|
297 | </xsl:call-template> |
---|
298 | ); |
---|
299 | |
---|
300 | var kendoGridConstructorJSON = $.extend |
---|
301 | (true, {} |
---|
302 | ,<xsl:call-template name="Kendo.baseGridJSON"/> |
---|
303 | ,<xsl:call-template name="Kendo.namedConfigurationJSON"> |
---|
304 | <xsl:with-param name="configurationName" select="'IndicatorProfileGrid'"/> |
---|
305 | </xsl:call-template> |
---|
306 | ,<xsl:call-template name="Kendo.requestGridJSON"> |
---|
307 | <xsl:with-param name="kendoDataSourceJavascriptVariableName" select="'kendoDataSource'"/> |
---|
308 | <xsl:with-param name="measure" select="$measure"/> |
---|
309 | <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> |
---|
310 | <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> |
---|
311 | <xsl:with-param name="showFooterRow" select="false()"/> |
---|
312 | <xsl:with-param name="showNoteColumn" select="false()"/> |
---|
313 | <xsl:with-param name="showLabelColumn" select="false()"/> |
---|
314 | </xsl:call-template> |
---|
315 | ); |
---|
316 | |
---|
317 | |
---|
318 | var kendoChartConstructorJSON = $.extend |
---|
319 | (true, {} |
---|
320 | ,<xsl:call-template name="Kendo.baseChartJSON"/> |
---|
321 | ,<xsl:call-template name="Kendo.namedConfigurationJSON"> |
---|
322 | <xsl:with-param name="configurationName" select="$indicatorView/CHART_NAME"/> |
---|
323 | </xsl:call-template> |
---|
324 | ,<xsl:call-template name="Kendo.requestChartJSON"> |
---|
325 | <xsl:with-param name="kendoDataSourceJavascriptVariableName" select="'kendoDataSource'"/> |
---|
326 | |
---|
327 | <xsl:with-param name="title" select="ibis:getCompleteIndicatorViewTitle($indicator, $indicatorView)"/> |
---|
328 | <xsl:with-param name="seriesTitle" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/TITLE"/> |
---|
329 | <xsl:with-param name="categoryTitle" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='category']/TITLE"/> |
---|
330 | <xsl:with-param name="valueTitle" select="$measure/TITLE"/> |
---|
331 | |
---|
332 | <xsl:with-param name="seriesFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/NAME"/> |
---|
333 | <xsl:with-param name="categoryFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='category']/NAME"/> |
---|
334 | |
---|
335 | <xsl:with-param name="includeDatasetSeries" select="1 < $recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/VALUE_COUNT"/> |
---|
336 | <xsl:with-param name="ancillaryValueNames" select="$ancillaryValueNames"/> |
---|
337 | </xsl:call-template> |
---|
338 | ); |
---|
339 | //console.debug("%o", kendoChartConstructorJSON); |
---|
340 | //console.log(JSON.stringify(kendoChartConstructorJSON,null,2)); |
---|
341 | |
---|
342 | var $kendoGrid; |
---|
343 | var $kendoChart; |
---|
344 | var $leafletMap; |
---|
345 | $(document).ready(function() |
---|
346 | { |
---|
347 | $kendoGrid = $("#grid").kendoGrid (kendoGridConstructorJSON); |
---|
348 | $kendoChart = $("#chart").kendoChart(kendoChartConstructorJSON); |
---|
349 | kendoDataSource.read(); // have to have after grid and chart because .autoBind = false. |
---|
350 | |
---|
351 | |
---|
352 | |
---|
353 | <!-- ===================================================== |
---|
354 | // var firstSlot = $kendoChart.getKendoChart()._plotArea.axes[0].getSlot(0); |
---|
355 | // alert("first slot width" + firstSlot.width()); |
---|
356 | |
---|
357 | <xsl:variable name="geoDimensionName" select=" |
---|
358 | if(0 != string-length($indicatorView/DEFAULT_GEOGRAPHY_DIM_NAME)) |
---|
359 | then $indicatorView/DEFAULT_GEOGRAPHY_DIM_NAME |
---|
360 | else ($indicator/DATASETS/DATASET/DIMENSIONS/DIMENSION[ |
---|
361 | exists(GEOGRAPHY_FLAG) |
---|
362 | and |
---|
363 | NAME = $indicatorView//DATASET_DIMENSION_USAGE/DIMENSION_NAME |
---|
364 | ])[1]/NAME" |
---|
365 | /> |
---|
366 | |
---|
367 | <xsl:message select="$indicator/DATASETS/DATASET/DIMENSIONS/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME"/> |
---|
368 | <xsl:message select="exists($indicatorView/DATASET_DIMENSION_USAGES/DATASET_DIMENSION_USAGES[DIMENSION_NAME = $indicator/DATASETS/DATASET/DIMENSIONS/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME])"/> |
---|
369 | <xsl:message select="exists($indicatorView/DATASET_DIMENSION_USAGES/DATASET_DIMENSION_USAGES[DIMENSION_NAME = $indicator/DATASETS/DATASET/DIMENSIONS/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME])"/> |
---|
370 | <xsl:message select="exists($indicatorView/DATASET_DIMENSION_USAGES/DATASET_DIMENSION_USAGES[DIMENSION_NAME = $indicator/DATASETS/DATASET/DIMENSIONS/DIMENSION[exists(GEOGRAPHY_FLAG)]])"/> |
---|
371 | <xsl:message select="$indicator/DATASETS/DATASET/DIMENSIONS/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME"/> |
---|
372 | <xsl:message select="concat('Interactive - Show Map: ', $Interactive.showMap, ', geoDimensionName:', $geoDimensionName)"/> |
---|
373 | |
---|
374 | <xsl:message select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX interact.xslt'"/> |
---|
375 | <xsl:message select="$Interactive.comparisonDimensionName"/> |
---|
376 | <xsl:message select="$Interactive.comparisonDimensionValue"/> |
---|
377 | <xsl:with-param name="comparisonValue" select="$indicatorViewDatasetRecords/RECORD[ DIMENSIONS[ (2 = count(DIMENSION)) and DIMENSION[(NAME = $Interactive.comparisonDimensionName) and (VALUE = $Interactive.comparisonDimensionValue)]]]/MEASURE_VALUE"/> |
---|
378 | |
---|
379 | Stuff to try when doing dashboard |
---|
380 | function dataSource_change(e) { |
---|
381 | console.log(e); |
---|
382 | } |
---|
383 | kendoDataSource.bind("change", dataSource_change); |
---|
384 | select="$indicatorViewDatasetRecords/RECORD[ DIMENSIONS[ (2 = count(DIMENSION)) and DIMENSION[(NAME = $Interactive.comparisonDimensionName) and (VALUE = $Interactive.comparisonDimensionValue)]]]/MEASURE_VALUE"/> |
---|
385 | |
---|
386 | ********************************************** |
---|
387 | |
---|
388 | PROBLEM: "CATEGORY":"GeoCnty.4" |
---|
389 | <xsl:with-param name="geoJSONName" select="$indicatorView/MAP_DIMENSION_NAME"/> |
---|
390 | |
---|
391 | ****************** |
---|
392 | probably need to geojson to have the geodim name + . + geodim value to uniquely ID the area. |
---|
393 | |
---|
394 | ************ PROBLEM is that the QM only returns 1..31 and not GeoCnty.1 |
---|
395 | |
---|
396 | The IP and QM dimension files are all 1..31 |
---|
397 | |
---|
398 | So, need the field name then use the geotype and parse the .XXX from the end. |
---|
399 | Then in the QM will need to build the JSON fields the same way as we do with |
---|
400 | the IP - which is the right way to do it anyway so fields can be combined??? |
---|
401 | |
---|
402 | *** also have issues with if 2d and 3d... |
---|
403 | if mult series then drop down for that. |
---|
404 | if mult constants then drop down for that as well. |
---|
405 | when changed regen map. |
---|
406 | Need to specify the category field name and value |
---|
407 | Need to specify the series field name and value |
---|
408 | Need to specify the constant field name and value |
---|
409 | |
---|
410 | GeoJSON GeoID Prefix to add when doing comparison??? |
---|
411 | |
---|
412 | <xsl:variable name="communityDatasets" select="$indicator/DATASETS/DATASET[DIMENSION_COMBINATIONS/DIMENSION_COMBINATION[not(DIMENSION_2/NAME) and DIMENSION_1/NAME = $communityDimensionName]]"/> |
---|
413 | <xsl:variable name="communityDataset" select="$communityDatasets[(MEASURE_NAME = $measureName) and DIMENSION_COMBINATIONS/DIMENSION_COMBINATION[PERIOD_DIMENSION/NAME = $periodName]]"/> |
---|
414 | <xsl:variable name="stateRecord" select="$communityDataset/RECORDS/RECORD[ DIMENSIONS[ (2 = count(DIMENSION)) and DIMENSION[(NAME = $stateDimensionName) and (VALUE = $stateDimensionValue)] and DIMENSION[(NAME = $periodName) and (VALUE = $periodValue)]]]"/> |
---|
415 | |
---|
416 | <xsl:message select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'"/> |
---|
417 | <xsl:message select="$indicatorViewDatasetRecords[1]"/> |
---|
418 | |
---|
419 | |
---|
420 | <xsl:with-param name="dimensionFieldInclusionCriteria"> |
---|
421 | records have the field names to filter. |
---|
422 | to include need field name and value. |
---|
423 | |
---|
424 | specifies the records held constant - This is to filter out not matching constant records |
---|
425 | |
---|
426 | for mouse overs, the title needs specifics - dimension title and dimension value title. |
---|
427 | <DIMENSION><NAME>CONSTANT</NAME><VALUE>YearAll.2014</VALUE><TITLE>Year</TITLE><VALUE_TITLE>2014</VALUE_TITLE></DIMENSION> |
---|
428 | <DIMENSION><NAME>SERIES</NAME><VALUE>Sex.1</VALUE><TITLE>Sex</TITLE><VALUE_TITLE>Male</VALUE_TITLE></DIMENSION> |
---|
429 | </xsl:with-param> |
---|
430 | |
---|
431 | ========================================================================== |
---|
432 | <xsl:message select="$indicatorViewDatasetRecords/RECORD"/> |
---|
433 | --> |
---|
434 | |
---|
435 | |
---|
436 | |
---|
437 | |
---|
438 | <xsl:message select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX interact.xslt'"/> |
---|
439 | <xsl:message select="$indicatorView/MAP_DIMENSION_NAME"/> |
---|
440 | <xsl:message select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_NAMES/DIMENSION_NAME = $indicatorView/MAP_DIMENSION_NAME]/NAME"/> |
---|
441 | |
---|
442 | |
---|
443 | <xsl:if test="ibis:LeafletMap.showMap($indicatorView/MAP_NAME)"> |
---|
444 | var leafletMapConstructorJSON = $.extend |
---|
445 | (true, {} |
---|
446 | ,<xsl:call-template name="LeafletMap.baseJSON"/> |
---|
447 | ,<xsl:call-template name="LeafletMap.namedConfigurationJSON"> |
---|
448 | <xsl:with-param name="configurationName" select="$indicatorView/MAP_NAME"/> |
---|
449 | </xsl:call-template> |
---|
450 | ,<xsl:call-template name="LeafletMap.requestJSON"> |
---|
451 | <!-- <xsl:with-param name="mapTitle" select="'Choropleth'"/> --> |
---|
452 | <xsl:with-param name="mapType" select="'choropleth'"/> |
---|
453 | </xsl:call-template> |
---|
454 | ,<xsl:call-template name="LeafletMap.choroplethJSON"> |
---|
455 | <xsl:with-param name="javascriptRecordArrayVariableName" select="'records'"/> |
---|
456 | <xsl:with-param name="geoJSONName" select="$indicatorView/MAP_DIMENSION_NAME"/> |
---|
457 | <xsl:with-param name="geoIDFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_NAMES/DIMENSION_NAME = $indicatorView/MAP_DIMENSION_NAME]/NAME"/> |
---|
458 | <xsl:with-param name="geoIDFieldValuePrefixToRemove" select="concat($indicatorView/MAP_DIMENSION_NAME, '.')"/> |
---|
459 | <xsl:with-param name="measureValueFieldName" select="'MeasureValue'"/> |
---|
460 | <xsl:with-param name="legendTitle" select="$measure/TITLE"/> |
---|
461 | <xsl:with-param name="geoTypeTitle" select="ibis:getDimensionTitle($indicator//DIMENSIONS/DIMENSION[NAME = $indicatorView/MAP_DIMENSION_NAME])"/> |
---|
462 | <xsl:with-param name="reverseColors" select="$measure/DESIRABLE_VALUE = 1"/> |
---|
463 | <xsl:with-param name="desirableIndexValue" select="$measure/DESIRABLE_VALUE"/> |
---|
464 | |
---|
465 | <xsl:with-param name="comparisonValue" select="$indicatorViewDatasetRecords/RECORD[ DIMENSIONS[ (2 = count(DIMENSION)) and DIMENSION[(NAME = $Interactive.comparisonDimensionName) and (VALUE = $Interactive.comparisonDimensionValue)]]]/MEASURE_VALUE"/> |
---|
466 | |
---|
467 | </xsl:call-template> |
---|
468 | ); |
---|
469 | $leafletMap = $("#map").leaflet(leafletMapConstructorJSON); |
---|
470 | <!-- |
---|
471 | <xsl:call-template name="LeafletMap.mapsJavaScript"/> |
---|
472 | <xsl:call-template name="LeafletMap.namedMapJavaScript"/> |
---|
473 | --> |
---|
474 | </xsl:if> |
---|
475 | |
---|
476 | }); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
477 | <!-- |
---|
478 | <xsl:call-template name="Kendo.chartsJavaScript"/> |
---|
479 | <xsl:call-template name="Kendo.namedChartJavaScript"/> |
---|
480 | <xsl:call-template name="Kendo.gridsJavaScript"/> |
---|
481 | <xsl:call-template name="Kendo.namedGridJavaScript"/> |
---|
482 | --> |
---|
483 | </script> |
---|
484 | </xsl:template> |
---|
485 | |
---|
486 | </xsl:stylesheet> |
---|
487 | <!-- ============================= End of File ============================= --> |
---|