Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade UUID, redux, fabric and d3 #144

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions assets/js/Ioda/components/modal/RawSignalsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ import React, { PureComponent } from "react";
import PropTypes from "prop-types";
import T from "i18n-react";
import Loading from "../../components/loading/Loading";
import LoadingIcon from "images/icons/icon-loading.png";
import Tooltip from "../tooltip/Tooltip";
import TopoMap from "../map/Map";
import Table from "../table/Table";
import * as d3 from "d3-shape";
import { curveStepAfter } from "d3-shape";
import {
horizonChartSeriesColor,
humanizeNumber,
Expand Down Expand Up @@ -284,7 +283,7 @@ class RawSignalsModal extends PureComponent {
.height(360)
.enableZoom(false)
.showRuler(true)
.interpolationCurve(d3.curveStepAfter)
.interpolationCurve(curveStepAfter)
.positiveColors(["white", color]).toolTipContent = ({
series,
ts,
Expand Down
4 changes: 2 additions & 2 deletions assets/js/Ioda/pages/dashboard/DashboardTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import TimeStamp from "../../components/timeStamp/TimeStamp";
import Tooltip from "../../components/tooltip/Tooltip";
import Table from "../../components/table/Table";
import HorizonTSChart from "horizon-timeseries-chart";
import * as d3 from "d3-shape";
import { curveStepAfter } from "d3-shape";
import TopoMap from "../../components/map/Map";
import { Button } from "antd";
import { asn } from "./DashboardConstants";
Expand Down Expand Up @@ -75,7 +75,7 @@ class DashboardTab extends Component {
.height(570)
.enableZoom(false)
.showRuler(true)
.interpolationCurve(d3.curveStepAfter)
.interpolationCurve(curveStepAfter)
.positiveColors(["white", horizonChartSeriesColor]).toolTipContent = ({
series,
ts,
Expand Down
7 changes: 4 additions & 3 deletions assets/js/Ioda/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
* IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
import d3 from 'd3';
import { geoBounds } from 'd3-geo';
import { format } from 'd3-format';
import T from 'i18n-react';
import { getColorFromLinearScale, getEntityScaleColor } from './mapColors';
import { secondsToUTC } from './timeUtils';
Expand Down Expand Up @@ -110,7 +111,7 @@ export const legend = [
// Humanize number with rounding, abbreviations, etc.
export function humanizeNumber(value, precisionDigits) {
precisionDigits = precisionDigits || 3;
return d3.format(
return format(
(isNaN(precisionDigits) ? '' : '.' + precisionDigits)
+ ((Math.abs(value) < 1) ? 'r' : 's')
)(value);
Expand Down Expand Up @@ -277,7 +278,7 @@ export function convertTsDataForHtsViz(tsData) {

// take a list of outages that will populate on a map and create a bounding box the map will use for zoom location
export function getOutageCoords(features) {
return features.map(d3.geo.bounds).reduce(function (prev, cur) {
return features.map(geoBounds).reduce(function (prev, cur) {
return [
[
Math.min(prev[0][0], cur[0][0]),
Expand Down
7 changes: 2 additions & 5 deletions assets/js/Ioda/utils/mapColors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import d3 from "d3";
import { scaleLinear } from "d3-scale";

export const LOW_COLOR = "#FFCC3D";
export const HIGH_COLOR = "#EE695B";
Expand Down Expand Up @@ -61,10 +61,7 @@ export const getColorFromLinearScale = (
minColor = LOW_COLOR,
maxColor = HIGH_COLOR
) => {
const linearScale = d3.scale
.linear()
.domain([minScore, maxScore])
.range([minColor, maxColor]);
const linearScale = scaleLinear([minScore, maxScore], [minColor, maxColor]);

return linearScale(score);
};
Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@
"axios": "^1.7.2",
"clsx": "^2.1.1",
"core-js": "^3.37.1",
"d3": "3",
"d3-shape": "^2.1.0",
"d3-format": "^3.1.0",
"d3-geo": "^3.1.1",
"d3-scale": "^4.0.2",
"d3-shape": "^3.2.0",
"dayjs": "^1.11.7",
"fabric": "^5.3.0",
"fabric-history": "^1.7.0",
"fabric": "^5.4.0",
"fabric-history": "^2.0.0",
"ga-4-react": "^0.1.281",
"highcharts": "^11.4.3",
"highcharts-react-official": "^3.2.1",
Expand All @@ -79,14 +81,14 @@
"react-helmet": "^6.1.0",
"react-leaflet": "^2.7.0",
"react-preload-image": "^1.0.7",
"react-redux": "^7.1.3",
"react-redux": "^9.1.2",
"react-router-dom": "^6.26.0",
"react-router-sitemap": "^1.2.0",
"react-share": "^5.1.0",
"react-style-tag": "^3.0.1",
"react-twitter-embed": "^4.0.4",
"topojson": "1.6.18",
"uuid": "^9.0.1"
"uuid": "^10.0.0"
},
"engines": {
"npm": ">=8.0.0 <9.0.0",
Expand Down
Loading