Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • E EnergyDashboard
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • iCity
  • EnergyDashboard
  • Merge requests
  • !24
An error occurred while fetching the assigned milestone of the selected merge_request.

Update logic for drop-down list

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Pithon Kabiro requested to merge wip_select-sensors-dropdown-list-9 into master 3 years ago
  • Overview 0
  • Commits 4
  • Pipelines 0
  • Changes 9

Further refactoring of the logic for the drop-down lists into new module files

  • Pithon Kabiro @pithon.kabiro assigned to @pithon.kabiro 3 years ago

    assigned to @pithon.kabiro

  • Pithon Kabiro @pithon.kabiro mentioned in commit 51d91889 3 years ago

    mentioned in commit 51d91889

  • Pithon Kabiro @pithon.kabiro merged 3 years ago

    merged

  • Loading
  • Loading
  • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
Please register or sign in to reply
Compare
  • master (base)

and
  • latest version
    015ec0df
    4 commits, 3 years ago

9 files
+ 237
- 200

    Preferences

    File browser
    Compare changes
publ‎ic/js‎
src_m‎odules‎
baseUrlPlusQu‎eryParams.mjs‎ +1 -5
dropDownListC‎hartColumn.mjs‎ +58 -1
dropDownListCh‎artHeatmap.mjs‎ +2 -1
dropDownList‎ChartLine.mjs‎ +58 -1
dropDownListChar‎tScatterPlot.mjs‎ +3 -2
dropDownLis‎tStyling.mjs‎ +53 -0
appCes‎ium.js‎ +3 -2
appCh‎art.js‎ +56 -188
.giti‎gnore‎ +3 -0
public/js/src_modules/baseUrlPlusQueryParams.mjs
+ 1
- 5
  • View file @ 015ec0df

  • Edit in single-file editor

  • Open in Web IDE


"use strict";
const BASE_URL = "http://193.196.39.91:8080/frost-icity-tp31/v1.1";
/**
* Create a temporal filter string for the fetched Observations
* @param {String} dateStart Start date in YYYY-MM-DD format
@@ -33,9 +31,7 @@ const createUrlParametersForGetRequest = function (dateStart, dateStop) {
};
};
const QUERY_PARAMS_COMBINED = createUrlParametersForGetRequest(
export const QUERY_PARAMS_COMBINED = createUrlParametersForGetRequest(
"2020-01-01",
"2021-01-01"
);
export { BASE_URL, QUERY_PARAMS_COMBINED };
public/js/src_modules/dropDownListChartColumn.mjs
+ 58
- 1
  • View file @ 015ec0df

  • Edit in single-file editor

  • Open in Web IDE


"use strict";
import { formatSensorThingsApiResponseForLineOrColumnChart } from "./chartHelpers.mjs";
import { extractPropertiesFromFormattedDatastreamMetadata } from "./fetchedDataProcessing.mjs";
import { drawColumnChartHighcharts } from "./chartColumn.mjs";
import {
@@ -33,7 +37,7 @@ import {
* @param {Array} formattedMetadataNestedArr An array of sub-arrays of formatted metadata properties
* @returns {undefined} undefined
*/
export const drawColumnChartBasedOnSelectedAggregationOptions = function (
const drawColumnChartBasedOnSelectedAggregationOptions = function (
selectedAggregationType,
selectedAggregationDuration,
observationsNestedArr,
@@ -157,3 +161,56 @@ export const drawColumnChartBasedOnSelectedAggregationOptions = function (
);
}
};
/**
* Draw a column chart based on the selected options from a drop-down list.
* This chart type supports both raw observations and aggregated observations
*
* @param {String} selectedAggregationType The selected aggregation type. The currently supported strings include `Sum`, `Maximum`, `Minimum` and `Average`
* @param {String} selectedAggregationDuration The selected aggregation duration. The currently supported strings include `Daily` and `Monthly`
* @param {Array} observationsNestedArr An array made up of sub-array(s) of observations
* @param {String} selectedSamplingRateAbbrev The abbreviated form of the selected sampling rate option
* @param {Array} uniqueCalendarDatesNestedArr An array made up of sub-array(s) of unique calendar date(s) string(s)
* @param {Array} formattedMetadataNestedArr An array of sub-arrays of formatted metadata properties
* @returns {undefined} undefined
*/
export const drawColumnChartBasedOnSelectedOptions = function (
selectedAggregationType,
selectedAggregationDuration,
observationsNestedArr,
selectedSamplingRateAbbrev,
uniqueCalendarDatesNestedArr,
formattedMetadataNestedArr
) {
// Case 1: Raw observations
if (selectedAggregationType === "None (raw data)") {
// Create formatted array(s) for observations
const formattedRawObservationsColumnChartNestedArr =
observationsNestedArr.map((observationsArr) =>
formatSensorThingsApiResponseForLineOrColumnChart(observationsArr)
);
// Extract formatted metadata properties
const rawObsExtractedFormattedDatastreamProperties =
extractPropertiesFromFormattedDatastreamMetadata(
formattedMetadataNestedArr,
false
);
drawColumnChartHighcharts(
formattedRawObservationsColumnChartNestedArr,
rawObsExtractedFormattedDatastreamProperties
);
}
// Case 2: Aggregated observations
else {
drawColumnChartBasedOnSelectedAggregationOptions(
selectedAggregationType,
selectedAggregationDuration,
observationsNestedArr,
selectedSamplingRateAbbrev,
uniqueCalendarDatesNestedArr,
formattedMetadataNestedArr
);
}
};
public/js/src_modules/dropDownListChartHeatmap.mjs
+ 2
- 1
  • View file @ 015ec0df

  • Edit in single-file editor

  • Open in Web IDE


@@ -6,7 +6,8 @@ import {
} from "./chartHeatmap.mjs";
/**
* Draw a heatmap based on the selected options from a drop-down list
* Draw a heatmap based on the selected options from a drop-down list.
* Currently, this chart type only supports raw observations
*
* @param {Array} observationsComboNestedArr An array that contains non-computed (raw) observations and computed (temperature difference, dT) observations
* @param {Object} extractedFormattedDatastreamProperties An object that contains array(s) of formatted Datastream properties
public/js/src_modules/dropDownListChartLine.mjs
+ 58
- 1
  • View file @ 015ec0df

  • Edit in single-file editor

  • Open in Web IDE


"use strict";
import { formatSensorThingsApiResponseForLineOrColumnChart } from "./chartHelpers.mjs";
import { extractPropertiesFromFormattedDatastreamMetadata } from "./fetchedDataProcessing.mjs";
import { drawLineChartHighcharts } from "./chartLine.mjs";
import {
@@ -33,7 +37,7 @@ import {
* @param {Array} formattedMetadataNestedArr An array of sub-arrays of formatted metadata properties
* @returns {undefined} undefined
*/
export const drawLineChartBasedOnSelectedAggregationOptions = function (
const drawLineChartBasedOnSelectedAggregationOptions = function (
selectedAggregationType,
selectedAggregationDuration,
observationsNestedArr,
@@ -157,3 +161,56 @@ export const drawLineChartBasedOnSelectedAggregationOptions = function (
);
}
};
/**
* Draw a line chart based on the selected options from a drop-down list.
* This chart type supports both raw observations and aggregated observations
*
* @param {String} selectedAggregationType The selected aggregation type. The currently supported strings include `Sum`, `Maximum`, `Minimum` and `Average`
* @param {String} selectedAggregationDuration The selected aggregation duration. The currently supported strings include `Daily` and `Monthly`
* @param {Array} observationsNestedArr An array made up of sub-array(s) of observations
* @param {String} selectedSamplingRateAbbrev The abbreviated form of the selected sampling rate option
* @param {Array} uniqueCalendarDatesNestedArr An array made up of sub-array(s) of unique calendar date(s) string(s)
* @param {Array} formattedMetadataNestedArr An array of sub-arrays of formatted metadata properties
* @returns {undefined} undefined
*/
export const drawLineChartBasedOnSelectedOptions = function (
selectedAggregationType,
selectedAggregationDuration,
observationsNestedArr,
selectedSamplingRateAbbrev,
uniqueCalendarDatesNestedArr,
formattedMetadataNestedArr
) {
// Raw observations
if (selectedAggregationType === "None (raw data)") {
// Create formatted array(s) for observations
const formattedRawObservationsLineChartNestedArr =
observationsNestedArr.map((observationsArr) =>
formatSensorThingsApiResponseForLineOrColumnChart(observationsArr)
);
// Extract formatted metadata properties
const rawObsExtractedFormattedDatastreamProperties =
extractPropertiesFromFormattedDatastreamMetadata(
formattedMetadataNestedArr,
false
);
drawLineChartHighcharts(
formattedRawObservationsLineChartNestedArr,
rawObsExtractedFormattedDatastreamProperties
);
}
// Aggregated observations
else {
drawLineChartBasedOnSelectedAggregationOptions(
selectedAggregationType,
selectedAggregationDuration,
observationsNestedArr,
selectedSamplingRateAbbrev,
uniqueCalendarDatesNestedArr,
formattedMetadataNestedArr
);
}
};
public/js/src_modules/dropDownListChartScatterPlot.mjs
+ 3
- 2
  • View file @ 015ec0df

  • Edit in single-file editor

  • Open in Web IDE


@@ -6,13 +6,14 @@ import {
} from "./chartScatterPlot.mjs";
/**
* Draw a scatter plot based on the selected options from a drop-down list
* Draw a scatter plot based on the selected options from a drop-down list.
* Currently, this chart type only supports raw observations
*
* @param {Array} observationsComboNestedArr An array that contains non-computed (raw) observations and computed (temperature difference, dT) observations
* @param {Object} extractedFormattedDatastreamProperties An object that contains array(s) of formatted Datastream properties
* @returns {undefined} undefined
*/
export const drawScatterPlotFromChartSelection = function (
export const drawScatterPlotBasedOnSelectedOptions = function (
observationsComboNestedArr,
extractedFormattedDatastreamProperties
) {
Assignee
Pithon Kabiro's avatar
Pithon Kabiro
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference:
Source branch: wip_select-sensors-dropdown-list-9

Menu

Explore Projects Groups Snippets

Dies ist die Gitlab-Instanz des Transferportals der Hochschule für Technik Stuttgart. Hier geht es zurück zum Portal