add alert-level-changes widget with working time range selector
This commit is contained in:
@@ -7,6 +7,9 @@ import { lazy } from 'react';
|
||||
// w: 4 = one-third screen width
|
||||
// w: 3 = one-quarter screen width
|
||||
|
||||
const getStartDate = () => (new Date(Date.now() - 604800000)).toLocaleDateString('en-CA'); // 7 days = 604800000 = 7*24*60*60*1000
|
||||
const getEndDate = () => (new Date()).toLocaleDateString('en-CA'); // 'en-CA' formats the date as YYYY-MM-DD
|
||||
|
||||
export const WIDGET_REGISTRY = {
|
||||
"vaa_activity": {
|
||||
name: "VAA 7 Day Activity",
|
||||
@@ -19,7 +22,9 @@ export const WIDGET_REGISTRY = {
|
||||
|
||||
// The baseline data every new VAA widget starts with
|
||||
defaultSettings: {
|
||||
yAxisScale: 'normal' // Options: 'normal' | 'symlog'
|
||||
// startDate: getStartDate(),
|
||||
// endDate: getEndDate(),
|
||||
yAxisScale: 'normal', // Options: 'normal' | 'symlog'
|
||||
},
|
||||
|
||||
allowedSizes: {
|
||||
@@ -44,6 +49,8 @@ export const WIDGET_REGISTRY = {
|
||||
component: lazy(() => import('../components/Widgets/IvansAlerts.jsx')),
|
||||
settingsComponent: lazy(() => import('../components/Widgets/settings/IvansAlertsSettings.jsx')),
|
||||
defaultSettings: {
|
||||
startDate: getStartDate(),
|
||||
endDate: getEndDate(),
|
||||
copyToClipboard: false,
|
||||
activeSorts: {
|
||||
timeSort: "desc",
|
||||
@@ -64,6 +71,8 @@ export const WIDGET_REGISTRY = {
|
||||
component: lazy(() => import('../components/Widgets/RemoteSensing.jsx')),
|
||||
settingsComponent: lazy(() => import('../components/Widgets/Settings/RemoteSensingSettings.jsx')),
|
||||
defaultSettings: {
|
||||
startDate: getStartDate(),
|
||||
endDate: getEndDate(),
|
||||
copyToClipboard: false,
|
||||
activeSorts: {
|
||||
timeSort: "desc",
|
||||
@@ -81,9 +90,15 @@ export const WIDGET_REGISTRY = {
|
||||
name: "Alert Level Changes",
|
||||
category: "Daily Alerts",
|
||||
description: "List of 7-day alert level changes with trend arrows.",
|
||||
component: lazy(() => import('../components/Widgets/AlertChanges.jsx')),
|
||||
settingsComponent: lazy(() => import('../components/Widgets/settings/AlertChangeSettings.jsx')),
|
||||
defaultSettings: {
|
||||
startDate: getStartDate(),
|
||||
endDate: getEndDate(),
|
||||
},
|
||||
allowedSizes: {
|
||||
small: { w: 3, h: 12 },
|
||||
large: { w: 9, h: 12 }
|
||||
small: { w: 3, h: 6 },
|
||||
large: { w: 3, h: 12 }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -99,6 +114,8 @@ export const WIDGET_REGISTRY = {
|
||||
|
||||
// The baseline data every new VAA widget starts with
|
||||
defaultSettings: {
|
||||
startDate: getStartDate(),
|
||||
endDate: getEndDate(),
|
||||
yAxisScale: 'normal' // Options: 'normal' | 'symlog'
|
||||
},
|
||||
allowedSizes: {
|
||||
@@ -112,7 +129,10 @@ export const WIDGET_REGISTRY = {
|
||||
description: "Plot of explosion heights over a weeks time.",
|
||||
component: lazy(() => import('../components/Widgets/PlumeEvents.jsx')),
|
||||
settingsComponent: lazy(() => import('../components/Widgets/settings/PlumeEventsSettings.jsx')),
|
||||
defaultSettings: {},
|
||||
defaultSettings: {
|
||||
startDate: getStartDate(),
|
||||
endDate: getEndDate(),
|
||||
},
|
||||
allowedSizes: {
|
||||
medium: { w: 6, h: 12 }
|
||||
}
|
||||
@@ -124,7 +144,10 @@ export const WIDGET_REGISTRY = {
|
||||
description: "Plot of number of seismic events over a weeks time.",
|
||||
component: lazy(() => import('../components/Widgets/SeismicEvents.jsx')),
|
||||
settingsComponent: lazy(() => import('../components/Widgets/settings/SeismicEventsSettings.jsx')),
|
||||
defaultSettings: {},
|
||||
defaultSettings: {
|
||||
startDate: getStartDate(),
|
||||
endDate: getEndDate(),
|
||||
},
|
||||
allowedSizes: {
|
||||
medium: { w: 6, h: 12 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user