mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
fixed 618
This commit is contained in:
parent
735ad204e4
commit
0ecd910f79
1 changed files with 2 additions and 3 deletions
|
|
@ -469,9 +469,8 @@ function editProvinces() {
|
||||||
|
|
||||||
function showChart() {
|
function showChart() {
|
||||||
// build hierarchy tree
|
// build hierarchy tree
|
||||||
const states = pack.states.map(s => {
|
const getColor = (s) => !s.i || s.removed || s.color[0] !== "#" ? "#666" : d3.color(s.color).darker();
|
||||||
return {id:s.i, state: s.i?0:null, color: s.i && s.color[0] === "#" ? d3.color(s.color).darker() : "#666"}
|
const states = pack.states.map(s => ({id: s.i, state: s.i ? 0 : null, color: getColor(s)}));
|
||||||
});
|
|
||||||
const provinces = pack.provinces.filter(p => p.i && !p.removed).map(p => {
|
const provinces = pack.provinces.filter(p => p.i && !p.removed).map(p => {
|
||||||
return {id:p.i+states.length-1, i:p.i, state:p.state, color:p.color,
|
return {id:p.i+states.length-1, i:p.i, state:p.state, color:p.color,
|
||||||
name:p.name, fullName:p.fullName, area:p.area, urban:p.urban, rural:p.rural}
|
name:p.name, fullName:p.fullName, area:p.area, urban:p.urban, rural:p.rural}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue