Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compendium-v2
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
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
geant-swd
compendium-v2
Commits
9a2ecccf
Commit
9a2ecccf
authored
2 years ago
by
Saket Agrahari
Browse files
Options
Downloads
Patches
Plain Diff
2nd axis issue Funding source
parent
ec388405
No related branches found
No related tags found
1 merge request
!35
2nd axis issue Funding source
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
compendium_v2/static/bundle.js
+1
-1
1 addition, 1 deletion
compendium_v2/static/bundle.js
webapp/src/pages/ChargingStructure.tsx
+4
-1
4 additions, 1 deletion
webapp/src/pages/ChargingStructure.tsx
webapp/src/pages/FundingSource.tsx
+114
-68
114 additions, 68 deletions
webapp/src/pages/FundingSource.tsx
with
119 additions
and
70 deletions
compendium_v2/static/bundle.js
+
1
−
1
View file @
9a2ecccf
This diff is collapsed.
Click to expand it.
webapp/src/pages/ChargingStructure.tsx
+
4
−
1
View file @
9a2ecccf
...
...
@@ -50,7 +50,10 @@ function ChargingStructurePage({ filterSelection, setFilterSelection }: inputPro
/>
return
(
<
DataPage
title
=
"Charging Structure"
category
=
{
Sections
.
Organisation
}
filter
=
{
filterNode
}
>
<
DataPage
title
=
"Charging Mechanism of NRENs per Year"
description
=
"
The
charging
structure
is
the
way
in
which
NRENs
charge
their
customers
for
the
services
they
provide
.
The
charging
structure
can
be
based
on
a
flat
fee
,
usage
based
fee
,
a
combination
of
both
,
or
no
direct
charge
."
category
=
{
Sections
.
Organisation
}
filter
=
{
filterNode
}
>
<
Table
className
=
"charging-struct-table"
striped
bordered
responsive
>
<
colgroup
>
<
col
span
=
{
1
}
style
=
{
{
width
:
"
10%
"
}
}
/>
...
...
This diff is collapsed.
Click to expand it.
webapp/src/pages/FundingSource.tsx
+
114
−
68
View file @
9a2ecccf
...
...
@@ -24,85 +24,129 @@ ChartJS.register(
export
const
chartOptions
=
{
maintainAspectRatio
:
false
,
animation
:
{
duration
:
0
maintainAspectRatio
:
false
,
animation
:
{
duration
:
0
,
},
plugins
:
{
legend
:
{
display
:
false
,
labels
:
{
boxWidth
:
20
,
boxHeight
:
30
,
pointStyle
:
"
rectRounded
"
,
borderRadius
:
6
,
useBorderRadius
:
true
,
},
},
plugins
:
{
legend
:
{
display
:
false
,
labels
:
{
boxWidth
:
20
,
boxHeight
:
30
,
pointStyle
:
"
rectRounded
"
,
borderRadius
:
6
,
useBorderRadius
:
true
,
},
},
},
scales
:
{
x
:
{
position
:
"
top
"
as const
,
stacked
:
true
,
ticks
:
{
font
:
{
size
:
20
,
family
:
"
Open Sans, sans-serif
"
,
weight
:
"
bold
"
,
},
scales
:
{
x
:
{
position
:
'
top
'
as const
,
stacked
:
true
,
ticks
:
{
font
:{
size
:
20
,
family
:
'
Open Sans, sans-serif
'
,
weight
:
'
bold
'
,
},
callback
:
(
value
:
string
|
number
)
=>
{
if
(
typeof
value
===
'
number
'
)
{
return
`
${
value
}
%`
;
}
return
value
;
},
},
callback
:
(
value
:
string
|
number
)
=>
{
if
(
typeof
value
===
"
number
"
)
{
return
`
${
value
}
%`
;
}
return
value
;
},
x2
:
{
stacked
:
true
,
ticks
:
{
callback
:
(
value
:
string
|
number
)
=>
{
if
(
typeof
value
===
'
number
'
)
{
return
`
${
value
}
%`
;
}
return
value
;
},
font
:
{
size
:
20
,
family
:
'
Open Sans, sans-serif
'
,
weight
:
'
bold
'
,
}
},
grid
:
{
display
:
false
,
drawTicks
:
false
,
drawBorder
:
false
,
},
min
:
0
,
max
:
100
},
},
xBottom
:
{
stacked
:
true
,
ticks
:
{
callback
:
(
value
:
string
|
number
)
=>
{
if
(
typeof
value
===
"
number
"
)
{
return
`
${
value
}
%`
;
}
return
value
;
},
y
:
{
stacked
:
true
,
ticks
:
{
autoSkip
:
false
,
font
:
{
size
:
20
,
family
:
'
Open Sans, sans-serif
'
,
weight
:
'
bold
'
,
}
},
font
:
{
size
:
20
,
family
:
"
Open Sans, sans-serif
"
,
weight
:
"
bold
"
,
},
},
grid
:
{
display
:
false
,
drawTicks
:
false
,
drawBorder
:
false
,
},
afterDataLimits
:
function
(
axis
)
{
if
(
Chart
.
instances
[
1
]
&&
axis
.
chart
.
scales
.
xBottom
)
{
axis
.
chart
.
scales
.
xBottom
.
options
.
min
=
Chart
.
instances
[
1
].
scales
.
x
.
min
;
axis
.
chart
.
scales
.
xBottom
.
options
.
max
=
Chart
.
instances
[
1
].
scales
.
x
.
max
;
}
},
},
indexAxis
:
"
y
"
as const
y
:
{
stacked
:
true
,
ticks
:
{
autoSkip
:
false
,
font
:
{
size
:
20
,
family
:
"
Open Sans, sans-serif
"
,
weight
:
"
bold
"
,
},
},
title
:
{
display
:
true
,
text
:
"
---- NREN's names ---
"
,
font
:
{
size
:
20
,
family
:
"
Open Sans, sans-serif
"
,
weight
:
"
bold
"
,
},
},
},
yRight
:
{
position
:
"
right
"
as const
,
stacked
:
true
,
ticks
:
{
autoSkip
:
true
,
font
:
{
size
:
10
,
family
:
"
Open Sans, sans-serif
"
,
weight
:
"
bold
"
,
},
callback
:
()
=>
{
return
getYearForAxisCategory
();
},
},
title
:
{
display
:
true
,
text
:
"
---- Selected year's order ---
"
,
font
:
{
size
:
20
,
family
:
"
Open Sans, sans-serif
"
,
weight
:
"
bold
"
,
},
},
offset
:
true
,
},
},
indexAxis
:
"
y
"
as const
,
};
function
getYearForAxisCategory
()
{
if
(
yearSelectionForAxes
.
length
>
1
)
{
return
[...
yearSelectionForAxes
].
sort
();
}
return
[];
}
let
yearSelectionForAxes
:
number
[]
=
[];
function
FundingSourceLegend
()
{
return
(
<
Container
className
=
"border rounded-3 border-1 funding-chart-Legend"
>
<
Row
fluid
className
=
"justify-content-center "
<
Row
className
=
"justify-content-center "
style
=
{
{
paddingLeft
:
'
7vw
'
}
}
>
<
Col
className
=
"d-flex align-items-center"
>
<
ColorBadge
key
=
{
0
}
index
=
{
0
}
/>
...
...
@@ -143,6 +187,8 @@ function FundingSourcePage({ filterSelection, setFilterSelection }: inputProps)
dataset
.
hidden
=
!
filterSelection
.
selectedYears
.
includes
(
parseInt
(
dataset
.
stack
));
});
yearSelectionForAxes
=
filterSelection
.
selectedYears
;
// remove the datapoints and labels for the nrens that aren't selected
// unfortunately we cannot just hide them because graph.js doesn't want
// to create a stack from a single dataset
...
...
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