Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-apps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Seismic Hazard Model Project
nshmp-apps
Commits
7dbeffcd
Commit
7dbeffcd
authored
5 months ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Patches
Plain Diff
add custom color scale
parent
7edf3b79
No related branches found
No related tags found
1 merge request
!500
RTGM Updates
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
projects/nshmp-apps/src/app/designmaps/rtgm/services/app.service.ts
+21
-2
21 additions, 2 deletions
...shmp-apps/src/app/designmaps/rtgm/services/app.service.ts
with
21 additions
and
2 deletions
projects/nshmp-apps/src/app/designmaps/rtgm/services/app.service.ts
+
21
−
2
View file @
7dbeffcd
...
...
@@ -35,7 +35,6 @@ interface DefaultPlotProps {
title
:
string
;
xLabel
:
string
;
yLabel
:
string
;
xRange
?:
number
[];
xType
?:
AxisType
;
yRange
?:
number
[];
...
...
@@ -301,6 +300,10 @@ export class AppService
}
}
private
colorScale
():
readonly
string
[]
{
return
d3Color
.
schemeGnBu
[
9
].
slice
(
3
,
8
);
}
private
createDerivativeFragilityPlot
(
iterations
:
IterationPlotData
):
NshmpPlot
{
...
...
@@ -351,7 +354,7 @@ export class AppService
yRange
:
number
[]
):
Partial
<
PlotData
>
[]
{
const
fragilitySlices
:
Partial
<
PlotData
>
[]
=
[];
const
colors
=
d3Color
.
schemeCategory10
;
const
colors
=
this
.
colorScale
()
;
iterations
.
forEach
((
iteration
,
index
)
=>
{
const
color
=
colors
[
index
%
iterations
.
length
];
...
...
@@ -463,7 +466,11 @@ export class AppService
const
hazardFragilityPlotData
:
Partial
<
PlotData
>
[]
=
[];
const
integralHazardFragilityPlotData
:
Partial
<
PlotData
>
[]
=
[];
const
colors
=
this
.
colorScale
();
iterations
.
forEach
((
iteration
,
index
)
=>
{
const
color
=
colors
[
index
%
iterations
.
length
];
const
name
=
index
===
iterations
.
length
-
1
?
'
Final Iteration
'
...
...
@@ -471,6 +478,9 @@ export class AppService
fragilityPlotData
.
push
({
hovertemplate
:
'
%{x} g, %{y}
'
,
line
:
{
color
,
},
mode
:
'
lines+markers
'
,
name
,
x
:
imls
,
...
...
@@ -479,6 +489,9 @@ export class AppService
derivativeFragilityPlotData
.
push
({
hovertemplate
:
'
%{x} g, %{y}
'
,
line
:
{
color
,
},
mode
:
'
lines+markers
'
,
name
,
x
:
imls
,
...
...
@@ -487,6 +500,9 @@ export class AppService
hazardFragilityPlotData
.
push
({
hovertemplate
:
'
%{x} g, %{y}
'
,
line
:
{
color
,
},
mode
:
'
lines+markers
'
,
name
,
x
:
imls
,
...
...
@@ -495,6 +511,9 @@ export class AppService
integralHazardFragilityPlotData
.
push
({
hovertemplate
:
'
%{x} g, %{y}
'
,
line
:
{
color
,
},
mode
:
'
lines+markers
'
,
name
,
x
:
imls
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment