Ignore:
Timestamp:
01/07/19 18:11:06 (4 years ago)
Author:
GarthBraithwaite_STG
Message:

db, admin, view, java - Added INITIATIVE GOAL and BASELINE values to the db and beans. Added ability to publish the raw INITs. Added updated kendo code to deal with some charts not expanding to 100% when contained within a hidden block. Also added window event to resize the chart. Fixed chart title adding mult \n when grid sort clicked. Added inputOnChangeAttribute to the ContentContainer?.xslt to allow js event handling on expand/collapse. Updated IP and QM result script generations to be similar.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ibisph-view/src/main/webapp/xslt/html/indicator/profile/view/Page.xslt

    r17710 r17716  
    125125                                        </xsl:call-template>
    126126                                </xsl:with-param>
     127                                <xsl:with-param name="inputOnChangeAttribute" select="'resizeKendoChart()'"/>
    127128                                <xsl:with-param name="show" select="not($Page.showMap)"/>
    128129                                <xsl:with-param name="addWikiAttribute" select="false()"/>
     
    224225                        <xsl:with-param name="measure"       select="$Indicator.measure"/>
    225226                        <xsl:with-param name="showMap"       select="$Page.showMap"/>
     227                        <xsl:with-param name="showChart"     select="$Page.showChart"/>
    226228                        <xsl:with-param name="baseExportFilename" select="ibis:getCompleteIndicatorViewTitle($indicator, $indicatorView, $Indicator.dimensions)"/>
    227229                </xsl:call-template>
     
    233235                <xsl:param name="indicatorView"/>
    234236                <xsl:param name="measure"/>
    235                 <xsl:param name="showMap"/>
     237                <xsl:param name="showMap"   select="$Page.showMap"/>
     238                <xsl:param name="showChart" select="$Page.showChart"/>
    236239                <xsl:param name="baseExportFilename" select="$indicatorView/TITLE"/>
    237 
    238                 <xsl:if test="$showMap">
    239                         <xsl:call-template name="Graphic.choroplethMapJavaScript"/>
    240                 </xsl:if>
    241240
    242241                <xsl:variable name="measureValueFormatPattern" select="($Indicator.valueTypes/VALUE_TYPE[NAME = $measure/VALUE_TYPE_NAME]/XSLT_FORMAT_PATTERN)[1]"/>
     
    252251                        </xsl:call-template>
    253252                </xsl:variable>
    254 <!-- GARTH TODO: remove
    255 <xsl:message select="'xxxxxxxxxxxxxxxxxxxxxxx'"/>
    256 <xsl:message select="$recordAncillaryValueFields"/>
    257 -->
    258253
    259254                <xsl:variable name="recordDimensionFields">
     
    276271                        script.  Very messy - decided just to do simple var and include it.
    277272                -->
     273
     274                <xsl:if test="$showMap">
     275                        <xsl:call-template name="Graphic.choroplethMapJavaScript"/>
     276                </xsl:if>
    278277                <script type="text/javascript" src="{$ibis.urlPrefix}js/jszip.js"/>
    279278                <script type="text/javascript">
     
    316315                        );
    317316
    318 <xsl:message select="'gggggggggggggg'"/>
    319 <xsl:message select="count($indicatorViewDatasetRecords/RECORD[0 != string-length(LABEL)])"/>
    320 <xsl:message select="exists($indicatorViewDatasetRecords/RECORD[0 != string-length(LABEL)])"/>
    321 <xsl:message select="$indicatorViewDatasetRecords/RECORD[0 != string-length(LABEL)]"/>
    322 <xsl:message select="'xxxxxxxxxxxx'"/>
    323 <xsl:message select="count($indicatorViewDatasetRecords/RECORD[0 != string-length(NOTE)])"/>
    324 <xsl:message select="'zzzzzzzzzz'"/>
    325 <xsl:message select="string-length($indicatorViewDatasetRecords/RECORD/NOTE)"/>
    326 
    327 
    328                         var kendoChartConstructorJSON = $.extend
    329                         (true, {}
    330                                 ,<xsl:call-template name="Kendo.baseChartJSON"/>
    331                                 ,<xsl:call-template name="Kendo.namedConfigurationJSON">
    332                                         <xsl:with-param name="configurationName" select="$indicatorView/CHART_NAME"/>
    333                                 </xsl:call-template>
    334                                 ,<xsl:call-template name="Kendo.requestChartJSON">
    335                                         <xsl:with-param name="kendoDataSourceJavascriptVariableName" select="'kendoDataSource'"/>
    336                                         <xsl:with-param name="title"         select="ibis:getIndicatorViewChartTitle($indicator, $indicatorView, $Indicator.dimensions)"/>
    337                                         <xsl:with-param name="seriesTitle"   select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/TITLE"/>
    338                                         <xsl:with-param name="categoryTitle" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='category']/TITLE"/>
    339                                         <xsl:with-param name="valueTitle"    select="$measure/TITLE"/>
    340 
    341                                         <xsl:with-param name="seriesFieldName"    select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/NAME"/>
    342                                         <xsl:with-param name="categoryFieldName"  select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='category']/NAME"/>
    343 
    344                                         <xsl:with-param name="includeDatasetSeries" select="1 &lt; $recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/VALUE_COUNT"/>
    345                                         <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/>
    346                                 </xsl:call-template>
    347                         );
    348                         console.debug("IP.Page.xslt (%o, kendoChartConstructorJSON, (JSON.stringify(kendoChartConstructorJSON):");
    349                         console.debug("%o", kendoChartConstructorJSON);
    350                         console.debug(JSON.stringify(kendoChartConstructorJSON,null,2)); 
    351 
    352                         var $kendoGrid;
    353                         var $kendoChart;
    354                         var $leafletMap;
    355                         $(document).ready(function()
    356                         {
    357                                 $kendoGrid  = $("#grid").kendoGrid (kendoGridConstructorJSON);
    358                                 $kendoChart = $("#chart").kendoChart(kendoChartConstructorJSON);
    359                                 kendoDataSource.read();         // have to have after grid and chart because .autoBind = false.
    360 //                              $kendoChart.width(1000);
    361 //                              $kendoChart.chartArea.width(1000);
    362 //                              $kendoChart.resize();
    363                                
    364 /* GARTH TODO:
    365 $("#grid tr[role='row']").on("mouseenter mouseover", function () {
    366         var row = $("#grid").data("kendoGrid").dataItem(this); //get the data item attached to this row being hovered
    367         chart.toggleHighlight(true,
    368                 function(point)
    369                 {
    370                         return point.dataItem.Id === row.rowID;
    371                 }
    372         ); //show the tooltip for the point where the Ids match
    373 });
    374 */
    375 
    376 
    377 <!-- =====================================================
    378 
    379 GARTH TODO:
    380 
    381 // var firstSlot = $kendoChart.getKendoChart()._plotArea.axes[0].getSlot(0);
    382 // alert("first slot width" + firstSlot.width());
    383 
    384 <xsl:variable name="geoDimensionName" select="
    385         if(0 != string-length($indicatorView/DEFAULT_GEOGRAPHY_DIM_NAME))
    386         then $indicatorView/DEFAULT_GEOGRAPHY_DIM_NAME
    387         else ($Indicator.dimensions/DIMENSION[
    388                         exists(GEOGRAPHY_FLAG)
    389                         and
    390                         NAME = $indicatorView//DIMENSION_USAGE/NAME
    391                 ])[1]/NAME"
    392 />
    393 
    394 <xsl:message select="$Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME"/>
    395 <xsl:message select="exists($indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[DIMENSION_NAME = $Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME])"/>
    396 <xsl:message select="exists($indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[DIMENSION_NAME = $Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME])"/>
    397 <xsl:message select="exists($indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[DIMENSION_NAME = $Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]])"/>
    398 <xsl:message select="$Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME"/>
    399 <xsl:message select="concat('Interactive - Show Map: ', $showMap, ', geoDimensionName:', $geoDimensionName)"/>
    400 
    401 <xsl:message select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX interact.xslt'"/>
    402 <xsl:message select="$Page.comparisonDimensionName"/>
    403 <xsl:message select="$Page.comparisonDimensionValue"/>
    404 <xsl:with-param name="comparisonValue" select="$indicatorViewDatasetRecords/RECORD[ DIMENSIONS[ (2 = count(DIMENSION)) and DIMENSION[(NAME = $Page.comparisonDimensionName)     and (VALUE = $Page.comparisonDimensionValue)]]]/MEASURE/VALUE"/>
    405 
    406 Stuff to try when doing dashboard
    407 function dataSource_change(e) {
    408   console.log(e);
    409 }
    410 kendoDataSource.bind("change", dataSource_change);
    411 select="$indicatorViewDatasetRecords/RECORD[ DIMENSIONS[ (2 = count(DIMENSION)) and DIMENSION[(NAME = $Page.comparisonDimensionName)     and (VALUE = $Page.comparisonDimensionValue)]]]/MEASURE/VALUE"/>
    412 
    413 **********************************************
    414 
    415 PROBLEM: "CATEGORY":"GeoCnty.4"
    416                                                 <xsl:with-param name="geoJSONName"      select="$indicatorView/MAP_DIMENSION_NAME"/>
    417                                                
    418 ******************
    419 probably need to geojson to have the geodim name + . + geodim value to uniquely ID the area.
    420 
    421 ************ PROBLEM is that the QM only returns 1..31 and not GeoCnty.1
    422 
    423 The IP and QM dimension files are all 1..31
    424 
    425 So, need the field name then use the geotype and parse the .XXX from the end.
    426 Then in the QM will need to build the JSON fields the same way as we do with
    427 the IP - which is the right way to do it anyway so fields can be combined???
    428 
    429 *** also have issues with if 2d and 3d...
    430         if mult series then drop down for that.
    431         if mult constants then drop down for that as well.
    432         when changed regen map.
    433         Need to specify the category field name and value
    434         Need to specify the series field name and value
    435         Need to specify the constant field name and value
    436        
    437         GeoJSON GeoID Prefix to add when doing comparison???
    438 
    439         <xsl:variable name="communityDatasets" select="$indicator/DATASETS/DATASET[DIMENSION_COMBINATIONS/DIMENSION_COMBINATION[not(DIMENSION_2/NAME) and DIMENSION_1/NAME = $communityDimensionName]]"/>
    440         <xsl:variable name="communityDataset"  select="$communityDatasets[(MEASURE_NAME = $measureName) and DIMENSION_COMBINATIONS/DIMENSION_COMBINATION[PERIOD_DIMENSION/NAME = $periodName]]"/>
    441         <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)]]]"/>
    442 
    443 
    444 GARTH TODO:
    445         <xsl:message select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'"/>
    446 <xsl:message select="$indicatorViewDatasetRecords[1]"/>
    447 
    448 
    449 
    450 <xsl:with-param name="dimensionFieldInclusionCriteria">
    451 records have the field names to filter.
    452 to include need field name and value.
    453 
    454 specifies the records held constant - This is to filter out not matching constant records
    455 
    456 for mouse overs, the title needs specifics - dimension title and dimension value title.
    457         <DIMENSION><NAME>CONSTANT</NAME><VALUE>YearAll.2014</VALUE><TITLE>Year</TITLE><VALUE_TITLE>2014</VALUE_TITLE></DIMENSION>
    458         <DIMENSION><NAME>SERIES</NAME><VALUE>Sex.1</VALUE><TITLE>Sex</TITLE><VALUE_TITLE>Male</VALUE_TITLE></DIMENSION>
    459 </xsl:with-param>
    460 
    461 ==========================================================================
    462 <xsl:message select="$indicatorViewDatasetRecords/RECORD"/>
    463 
    464 <xsl:message select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX interact.xslt'"/>
    465 <xsl:message select="$indicatorView/MAP_DIMENSION_NAME"/>
    466 <xsl:message select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_NAMES/DIMENSION_NAME = $indicatorView/MAP_DIMENSION_NAME]/NAME"/>
    467 -->
    468 
    469                         <xsl:if test="$Page.showMap">
    470                                 var leafletMapConstructorJSON = $.extend
     317                        <xsl:if test="$showMap">
     318                        var leafletMapConstructorJSON = $.extend
    471319                                (true, {}
    472320,<xsl:call-template name="LeafletMap.baseJSON"/>
     
    493341</xsl:call-template>
    494342                                );
     343                        </xsl:if>
     344
     345// GARTH TODO: remove
     346<xsl:message select="'gggggggggggggg'"/>
     347<xsl:message select="count($indicatorViewDatasetRecords/RECORD[0 != string-length(LABEL)])"/>
     348<xsl:message select="exists($indicatorViewDatasetRecords/RECORD[0 != string-length(LABEL)])"/>
     349<xsl:message select="$indicatorViewDatasetRecords/RECORD[0 != string-length(LABEL)]"/>
     350<xsl:message select="'xxxxxxxxxxxx'"/>
     351<xsl:message select="count($indicatorViewDatasetRecords/RECORD[0 != string-length(NOTE)])"/>
     352<xsl:message select="'zzzzzzzzzz'"/>
     353<xsl:message select="string-length($indicatorViewDatasetRecords/RECORD/NOTE)"/>
     354
     355
     356                        <xsl:if test="$showChart">
     357                        var chartWidthVariable = $(".ExpandableContent").innerWidth();
     358                        var kendoChartConstructorJSON = $.extend
     359                        (true, {}
     360                                ,<xsl:call-template name="Kendo.baseChartJSON"/>
     361                                ,<xsl:call-template name="Kendo.namedConfigurationJSON">
     362                                        <xsl:with-param name="configurationName" select="$indicatorView/CHART_NAME"/>
     363                                </xsl:call-template>
     364                                ,<xsl:call-template name="Kendo.requestChartJSON">
     365                                        <xsl:with-param name="kendoDataSourceJavascriptVariableName" select="'kendoDataSource'"/>
     366                                        <xsl:with-param name="title"         select="ibis:getIndicatorViewChartTitle($indicator, $indicatorView, $Indicator.dimensions)"/>
     367                                        <xsl:with-param name="seriesTitle"   select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/TITLE"/>
     368                                        <xsl:with-param name="categoryTitle" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='category']/TITLE"/>
     369                                        <xsl:with-param name="valueTitle"    select="$measure/TITLE"/>
     370
     371                                        <xsl:with-param name="seriesFieldName"    select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/NAME"/>
     372                                        <xsl:with-param name="categoryFieldName"  select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='category']/NAME"/>
     373
     374                                        <xsl:with-param name="includeDatasetSeries" select="1 &lt; $recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/VALUE_COUNT"/>
     375                                        <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/>
     376                                </xsl:call-template>
     377                        );
     378
     379                        // have to manually add this because Kendo can't.  See:
     380                        // https://docs.telerik.com/kendo-ui/styles-and-layout/using-kendo-in-responsive-web-pages
     381                        // another option: $(window).on("resize", function() { kendo.resize($(".chart-wrapper")); });
     382                        $(window).resize(resizeKendoChart);
     383
     384                        console.debug("IP.Page.xslt (%o, kendoChartConstructorJSON, (JSON.stringify(kendoChartConstructorJSON):");
     385                        console.debug("%o", kendoChartConstructorJSON);
     386                        console.debug(JSON.stringify(kendoChartConstructorJSON,null,2)); 
     387                        </xsl:if>
     388
     389
     390                        var $kendoGrid;
     391                        var $kendoChart;
     392                        var $leafletMap;
     393                        $(document).ready(function()
     394                        {
     395                        <xsl:if test="$showMap">
    495396                                $leafletMap = $("#map").leaflet(leafletMapConstructorJSON);
    496397                        </xsl:if>
    497 
    498                         }); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    499 
     398                        <xsl:if test="$showChart">
     399                                $kendoChart = $("#chart").kendoChart(kendoChartConstructorJSON);
     400                        </xsl:if>
     401                                $kendoGrid  = $("#grid").kendoGrid(kendoGridConstructorJSON);
     402
     403                                // "read" fires the "change" event of the dataSource and any objects
     404                                // that ref the data source will be bound.  This needs to occur
     405                                // after the grid and chart are created because .autoBind = false.
     406                                // Can also fire load by issuing a sort:
     407                                // $kendoGrid.getKendoGrid().dataSource.sort({field: "CategorySortOrder", dir: "asc"});
     408                                kendoDataSource.read();
     409
     410                                // Kendo charts have an issue sizing the widget to the full width
     411                                // when the chart's container starts out hidden.  Tried numerous
     412                                // things with timers and setting the width to the main content
     413                                // control to firing resize when the control's input is changed.
     414                                // If set the width then even as the window resizes the chart does
     415                                // NOT change its size.  So below code was commented out and the
     416                                // input on change calls the resize func. 
     417                                // var chartContainerWidth = $(".ExpandableContent").innerWidth();
     418                                // $kendoChart.getKendoChart().options.chartArea.width = chartContainerWidth;
     419                        }); //~~~~~~~~~~~~~~~~~~~~ End of Ready Function ~~~~~~~~~~~~~~~~~~~
     420
     421
     422                        // Called via the chart's expandable content input element's onchange
     423                        // firing this code.  Also bound to the windonws resize event to
     424                        // properly resize the chart to fit the container.
     425                        function resizeKendoChart()
     426                        {
     427                                kendo.resize( $(".k-chart") );
     428                                // another option: $kendoChart.getKendoChart().resize();
     429                        } //~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~
     430               
    500431
    501432                        var baseExportFilename = "<xsl:value-of select="$baseExportFilename"/>";
     
    503434                        function exportGrid()
    504435                        {
    505                                 var grid = $("#grid").getKendoGrid();
     436                                var grid = $kendoGrid.getKendoGrid();
    506437                                grid.options.excel.fileName = baseExportFilename + " - data.xlsx";
    507438                                grid.saveAsExcel();
    508                         } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     439                        } //~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~
    509440
    510441                        function exportChart()
    511442                        {
    512                                 var chart = $("#chart").getKendoChart();
    513 
    514 <!--
     443                                var chart = $kendoChart.getKendoChart();
     444
    515445                                chart.exportImage().done
    516446                                (
     
    530460dataURI: "data:text/plain,Report title and text",
    531461*/
    532 -->
    533462                                chart.exportPDF().done
    534463                                (
     
    542471                                        }
    543472                                );
    544 
    545                         } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     473                        } //~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~
    546474
    547475                        function exportMap()
    548476                        {
    549477                                alert("Map export is not current supported.");
    550                         } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     478                        } //~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~
     479
     480<!--
     481==========================================================================
     482==========================================================================
     483==========================================================================
     484
     485
     486                                // Hack for vert bar charts to fill the width of the container.
     487                                // Kendo charts have an issue filling when the container is hidden.
     488                                // For some reason on my system need to wait 2 seconds for it
     489                                // to work.
     490                                // If set width then it's that size no matter what the window is
     491                                // resized to.  Only 100% sure fire way is to have open or fire
     492                                // some script when opened.
     493//                              setTimeout(resizeKendoChart, 1000);
     494                                var chartContainerWidth = $(".ExpandableContent").innerWidth();
     495//                              $kendoChart.getKendoChart().options.chartArea.width = chartContainerWidth;
     496//                              $("#chart").width = $(".ExpandableContent").innerWidth();
     497                                $kendoChart.getKendoChart().resize();
     498                        });
     499
     500                        function resizeKendoChart()
     501                        {
     502//                              var chartContainerWidth = $(".ExpandableContent").innerWidth();
     503//                              $kendoChart.getKendoChart().options.chartArea.width = chartContainerWidth;
     504                                $kendoChart.getKendoChart().resize();
     505//                              $kendoChart.resize($("#chart"));
     506                        };
     507
     508function myFunction() {
     509                                kendoDataSource.read();
     510                                $kendoChart.getKendoChart().resize();
     511                                $kendoChart.getKendoChart().refresh();
     512                                $kendoChart.getKendoChart().redraw();
     513                                $kendoGrid.getKendoGrid().dataSource.sort({field: "CategorySortOrder", dir: "asc"});
     514}
     515
     516/*                     
     517// none of these have any effect on the chart!!!
     518//                              $kendoGrid.getKendoGrid().refresh();
     519//                              $kendoChart.width(1000);
     520//                              $kendoChart.chartArea.width(1000);
     521//                              $kendoChart.getKendoChart().resize();
     522//                              $kendoChart.getKendoChart().refresh();
     523//                              $kendoChart.getKendoChart().redraw();
     524
     525$kendoGrid.getKendoGrid().dataSource.sort({field: "CategorySortOrder", dir: "asc"});
     526                                $kendoGrid.getKendoGrid().refresh();
     527                                $kendoChart.getKendoChart().redraw();
     528*/
     529
     530/* GARTH TODO:
     531$("#grid tr[role='row']").on("mouseenter mouseover", function () {
     532        var row = $("#grid").data("kendoGrid").dataItem(this); //get the data item attached to this row being hovered
     533        chart.toggleHighlight(true,
     534                function(point)
     535                {
     536                        return point.dataItem.Id === row.rowID;
     537                }
     538        ); //show the tooltip for the point where the Ids match
     539
     540
     541
     542
     543GARTH TODO:
     544
     545// var firstSlot = $kendoChart.getKendoChart()._plotArea.axes[0].getSlot(0);
     546// alert("first slot width" + firstSlot.width());
     547
     548<xsl:variable name="geoDimensionName" select="
     549        if(0 != string-length($indicatorView/DEFAULT_GEOGRAPHY_DIM_NAME))
     550        then $indicatorView/DEFAULT_GEOGRAPHY_DIM_NAME
     551        else ($Indicator.dimensions/DIMENSION[
     552                        exists(GEOGRAPHY_FLAG)
     553                        and
     554                        NAME = $indicatorView//DIMENSION_USAGE/NAME
     555                ])[1]/NAME"
     556/>
     557
     558<xsl:message select="$Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME"/>
     559<xsl:message select="exists($indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[DIMENSION_NAME = $Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME])"/>
     560<xsl:message select="exists($indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[DIMENSION_NAME = $Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME])"/>
     561<xsl:message select="exists($indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[DIMENSION_NAME = $Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]])"/>
     562<xsl:message select="$Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME"/>
     563<xsl:message select="concat('Interactive - Show Map: ', $showMap, ', geoDimensionName:', $geoDimensionName)"/>
     564
     565<xsl:message select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX interact.xslt'"/>
     566<xsl:message select="$Page.comparisonDimensionName"/>
     567<xsl:message select="$Page.comparisonDimensionValue"/>
     568<xsl:with-param name="comparisonValue" select="$indicatorViewDatasetRecords/RECORD[ DIMENSIONS[ (2 = count(DIMENSION)) and DIMENSION[(NAME = $Page.comparisonDimensionName)     and (VALUE = $Page.comparisonDimensionValue)]]]/MEASURE/VALUE"/>
     569
     570Stuff to try when doing dashboard
     571function dataSource_change(e) {
     572  console.log(e);
     573}
     574kendoDataSource.bind("change", dataSource_change);
     575select="$indicatorViewDatasetRecords/RECORD[ DIMENSIONS[ (2 = count(DIMENSION)) and DIMENSION[(NAME = $Page.comparisonDimensionName)     and (VALUE = $Page.comparisonDimensionValue)]]]/MEASURE/VALUE"/>
     576
     577**********************************************
     578
     579PROBLEM: "CATEGORY":"GeoCnty.4"
     580                                                <xsl:with-param name="geoJSONName"      select="$indicatorView/MAP_DIMENSION_NAME"/>
     581                                               
     582******************
     583probably need to geojson to have the geodim name + . + geodim value to uniquely ID the area.
     584
     585************ PROBLEM is that the QM only returns 1..31 and not GeoCnty.1
     586
     587The IP and QM dimension files are all 1..31
     588
     589So, need the field name then use the geotype and parse the .XXX from the end.
     590Then in the QM will need to build the JSON fields the same way as we do with
     591the IP - which is the right way to do it anyway so fields can be combined???
     592
     593*** also have issues with if 2d and 3d...
     594        if mult series then drop down for that.
     595        if mult constants then drop down for that as well.
     596        when changed regen map.
     597        Need to specify the category field name and value
     598        Need to specify the series field name and value
     599        Need to specify the constant field name and value
     600       
     601        GeoJSON GeoID Prefix to add when doing comparison???
     602
     603        <xsl:variable name="communityDatasets" select="$indicator/DATASETS/DATASET[DIMENSION_COMBINATIONS/DIMENSION_COMBINATION[not(DIMENSION_2/NAME) and DIMENSION_1/NAME = $communityDimensionName]]"/>
     604        <xsl:variable name="communityDataset"  select="$communityDatasets[(MEASURE_NAME = $measureName) and DIMENSION_COMBINATIONS/DIMENSION_COMBINATION[PERIOD_DIMENSION/NAME = $periodName]]"/>
     605        <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)]]]"/>
     606
     607
     608GARTH TODO:
     609        <xsl:message select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'"/>
     610<xsl:message select="$indicatorViewDatasetRecords[1]"/>
     611
     612
     613
     614<xsl:with-param name="dimensionFieldInclusionCriteria">
     615records have the field names to filter.
     616to include need field name and value.
     617
     618specifies the records held constant - This is to filter out not matching constant records
     619
     620for mouse overs, the title needs specifics - dimension title and dimension value title.
     621        <DIMENSION><NAME>CONSTANT</NAME><VALUE>YearAll.2014</VALUE><TITLE>Year</TITLE><VALUE_TITLE>2014</VALUE_TITLE></DIMENSION>
     622        <DIMENSION><NAME>SERIES</NAME><VALUE>Sex.1</VALUE><TITLE>Sex</TITLE><VALUE_TITLE>Male</VALUE_TITLE></DIMENSION>
     623</xsl:with-param>
     624
     625==========================================================================
     626<xsl:message select="$indicatorViewDatasetRecords/RECORD"/>
     627
     628<xsl:message select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX interact.xslt'"/>
     629<xsl:message select="$indicatorView/MAP_DIMENSION_NAME"/>
     630<xsl:message select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_NAMES/DIMENSION_NAME = $indicatorView/MAP_DIMENSION_NAME]/NAME"/>
     631
     632==========================================================================
     633==========================================================================
     634==========================================================================
     635-->
     636
    551637                </script>
    552638
Note: See TracChangeset for help on using the changeset viewer.