Skip to content

Commit

Permalink
Further linting through graph.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mollybsmith-noaa committed Aug 16, 2024
1 parent 23fc6a7 commit bfb87c5
Show file tree
Hide file tree
Showing 30 changed files with 1,017 additions and 1,042 deletions.
29 changes: 28 additions & 1 deletion meteor_packages/mats-common/imports/startup/client/graph_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2021 Colorado State University and Regents of the University of Colorado. All rights reserved.
*/

import { matsTypes } from "meteor/randyp:mats-common";
import { matsTypes, matsCurveUtils } from "meteor/randyp:mats-common";

/* global $, Session */
/* eslint-disable no-console */
Expand Down Expand Up @@ -562,6 +562,32 @@ const setDefaultView = function () {
window.onbeforeunload = null;
};

const graphPlotly = function () {
// get plot info
const route = Session.get("route");

// get dataset info and options
const resultSet = matsCurveUtils.getGraphResult();
if (resultSet === null || resultSet === undefined || resultSet.data === undefined) {
return false;
}

// set options
const { options } = resultSet;
if (route !== undefined && route !== "") {
options.selection = [];
}

// initialize show/hide button labels
const dataset = resultSet.data;
if (Session.get("graphPlotType") !== matsTypes.PlotTypes.map) {
setNoDataLabels(dataset);
} else {
setNoDataLabelsMap(dataset);
}
return null;
};

const downloadFile = function (fileURL, fileName) {
// for non-IE
if (!window.ActiveXObject) {
Expand Down Expand Up @@ -609,6 +635,7 @@ export default matsGraphUtils = {
setGraphView,
standAloneSetGraphView,
setDefaultView,
graphPlotly,
downloadFile,
setScorecardDisplayView,
};
6 changes: 3 additions & 3 deletions meteor_packages/mats-common/imports/startup/client/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ FlowRouter.route("/JSON/:graphFunction/:key/:matching/:appName", {
FlowRouter.route("/preview/:graphFunction/:key/:matching/:appName", {
name: "preview",
action(params) {
this.render("GraphStandAlone", params);
this.render("graphStandAlone", params);
},
});

Expand Down Expand Up @@ -111,7 +111,7 @@ FlowRouter.route(
{
name: "preview",
action(params) {
this.render("GraphStandAlone", params);
this.render("graphStandAlone", params);
},
}
);
Expand Down Expand Up @@ -185,7 +185,7 @@ FlowRouter.route(
{
name: "preview",
action(params) {
this.render("GraphStandAlone", params);
this.render("graphStandAlone", params);
},
}
);
Expand Down
Loading

0 comments on commit bfb87c5

Please sign in to comment.