OpenWaterFoundation / owf-app-dev-ng

Open Water Foundation Angular application to develop common libraries
0 stars 1 forks source link

Charts - test using URL for time series path #46

Open smalers opened 2 years ago

smalers commented 2 years ago

The following functionality needs to be tested, for example, by accessing time series data in a GitHub repository.

Now that the chart component is being used more, we need to ensure that it handles using a full URL for the time series file. This will allow InfoMapper configurations served on one URL (e.g., https://poudre.openwaterfoundation.org/) to access data on another URL (e.g., https://data.openwaterfoundation.org). There may be CORS issues if the domains are different but if all is being served from an OWF domain, we can avoid that issue for now. An example of a graph template file for a time series as follows:

      "data" : [ {
        "properties" : {
          "Color" : "#fffe31",
          "DataLabelFormat" : "",
          "DataLabelPosition" : "Right",
          "Enabled" : "True",
          "FlaggedDataSymbolStyle" : "",
          "GraphType" : "",
          "LegendFormat" : "Auto",
          "LineStyle" : "Solid",
          "LineWidth" : "0",
          "RasterGraphLegendPosition" : "Right",
          "SymbolSize" : "0",
          "SymbolStyle" : "None",
          "SymbolTablePath" : "",
          "TSAlias" : "10190007-USDM-D0",
          "TSID" : "10190007.USDM.D0.Day~DateValue~/dashboards/water-supply-basin/results/10190007-USDM-D0.dv",
          "XAxis" : "Bottom",
          "YAxis" : "Left"
        }
      },

The TSID property specifies a file path relative to the application root data. If the data were stored on another URL, the property might look like the following. This can be tested by saving a data file in GitHub and testing using that URL.

"TSID" : "10190007.USDM.D0.Day~DateValue~https://data.openwaterfoundation.org/datasets/ts/usdm/huc/10190007-USDM-D0.dv",

Enhancement

The following enhancements would provide more flexibility.

If application properties are added (define a property in the InfoMapper configuration), it would be possible to do something like the following:

"TSID" : "10190007.USDM.D0.Day~DateValue~${dataserver}/datasets/ts/usdm/huc/10190007-USDM-D0.dv",

If dashboard properties are added (define a property in the dashboard configuration), it would be possible to do something like the following:

"TSID" : "10190007.USDM.D0.Day~DateValue~${dashboard:datapath}/datasets/ts/usdm/huc/10190007-USDM-D0.dv",