Skip to content

Commit

Permalink
Merge pull request #60 from Alex-NRCan/feat-more-states-enhancements-…
Browse files Browse the repository at this point in the history
…validations

Datasets/Legend now appearing for all data. Added OGC Feature support sample... (#60)
  • Loading branch information
jolevesq authored Dec 8, 2023
2 parents 8443649 + 6b80882 commit dd7bd11
Show file tree
Hide file tree
Showing 11 changed files with 1,505 additions and 804 deletions.
41 changes: 38 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
}]
};

const DATA_INPUT_LINE_3 = {
const DATA_INPUT_BAR_3 = {
chart: 'bar',
title: 'Bar Chart with OGC Features',
query: {
Expand Down Expand Up @@ -251,6 +251,40 @@
}]
};

const DATA_INPUT_LINE_3 = {
chart: 'line',
title: 'Line Chart with OGC Features',
query: {
type: "ogcAPIFeatures",
url: "https://api.czs-dev.services.geo.ca/collections/sante_canada_tab",
queryOptions: {
whereClauses: [
{
field: "location_name",
prefix: "'",
valueIs: "8000_8_45.1134_-66.8242",
suffix: "'"
}]
}
},
geochart: {
xAxis: {
type: 'time',
property: 'start_time',
},
yAxis: {
property: 'value_nsvhr'
}
},
ui: {
resetStates: true,
download: true
},
datasources: [{
display: "Data",
}]
};

const DATA_INPUT_2 = {
chart: 'bar',
title: 'Bar Chart',
Expand Down Expand Up @@ -712,7 +746,8 @@
<button onclick="importDataInputs(DATA_INPUT_LINE_1)">Import Chart w/ time w/steps</button>
<button onclick="importDataInputs(DATA_INPUT_LINE_2)">Import Chart w/ time logar. w/tension</button>
<button onclick="importDataInputs(DATA_INPUT_LINE_2_SLIM)">Import Chart slim</button>
<button onclick="importDataInputs(DATA_INPUT_LINE_3)">Import Chart w/ OGC Features simple</button>
<button onclick="importDataInputs(DATA_INPUT_LINE_3)">Imp. OGC Line</button>
<button onclick="importDataInputs(DATA_INPUT_BAR_3)">Imp. OGC Bar</button>
<br/>
<button onclick="importDataInputs(DATA_INPUT_2)">Import Data BAR</button>
<button onclick="importDataInputs(DATA_INPUT_3)">Import Data PIE</button>
Expand Down Expand Up @@ -857,7 +892,7 @@
}

// Load data 1
importDataInputs(DATA_INPUT_LINE_1);
importDataInputs(DATA_INPUT_LINE_1); // DATA_INPUT_LINE_3
importDataParsed(DATA_NATIVE_1);
importOptionsParsed(OPTIONS_NATIVE_1);

Expand Down
3 changes: 2 additions & 1 deletion locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"parsingError": "There was an error parsing the Chart inputs.",
"viewConsoleDetails": "View console for details.",
"downloadFiltered": "Download visible",
"downloadAll": "Download all"
"downloadAll": "Download all",
"resetStates": "Reset states"
}
}
3 changes: 2 additions & 1 deletion locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"parsingError": "Une erreur est survenue lors de la lecture des paramètres.",
"viewConsoleDetails": "Voir détails dans la console.",
"downloadFiltered": "Télécharger visuel",
"downloadAll": "Télécharger tout"
"downloadAll": "Télécharger tout",
"resetStates": "Réinitialiser états"
}
}
5 changes: 4 additions & 1 deletion schema-chartjs-options.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "GeoChart Options Schema",
"description": "This Schema validator validates the ChartJS options. ABSOLUTELY UNFINISHED.",
"description": "This Schema validator validates the ChartJS options.",
"type": "object",
"properties": {
"responsive": { "type": "boolean" },
Expand All @@ -15,6 +15,9 @@
}
}
}
},
"scales": {
"type": "object"
}
},
"required": ["responsive", "plugins"]
Expand Down
Loading

0 comments on commit dd7bd11

Please sign in to comment.