Skip to content

Commit

Permalink
fix(links): colors and widths of bare networks not set correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
billyc committed Feb 10, 2022
1 parent f7cbd72 commit af13e2f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/js/DashboardDataManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default class DashboardDataManager {
public async getRoadNetwork(path: string) {
// first, get the dataset
if (!this.networks[path]) {
console.log(111, 'load network:', path)
console.log('load network:', path)

// fetchNetwork immediately returns a Promise<>, which we wait on so that
// multiple views don't all try to fetch the network individually
Expand Down
17 changes: 15 additions & 2 deletions src/plugins/links-gl/LinkVolumes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,12 @@ class MyPlugin extends Vue {
const { columnName, dataset, scaleFactor } = width
// if dataset is set to None, just set scale to 0 and we're done
if (!dataset) {
this.scaleWidth = 0
return
}
// change scaling factor without recalculating anything:
if (scaleFactor !== undefined) this.scaleWidth = scaleFactor
Expand Down Expand Up @@ -474,7 +480,7 @@ class MyPlugin extends Vue {
const columnName = color.columnName
if (!columnName) {
// this.csvData.activeColumn = ''
this.generateColorArray()
return
}
Expand Down Expand Up @@ -719,8 +725,8 @@ class MyPlugin extends Vue {
const csvRow = this.csvData.csvRowFromLinkRow[i]
let value = buildData[this.csvData.activeColumn]?.values[csvRow]
if (!value) return colorInvisible
if (this.generatedColors.length === 1) return colorsAsRGB[0]
if (!value) return colorInvisible
if (isCategorical) return setColorBasedOnValue(value)
if (this.vizDetails.showDifferences) {
Expand Down Expand Up @@ -795,6 +801,13 @@ class MyPlugin extends Vue {
this.myState.statusMessage = ''
this.setDataIsLoaded()
const color: ColorDefinition = {
generatedColors: this.generatedColors,
dataset: '',
columnName: '',
}
this.changeConfiguration({ color })
}
private handleDatasetisLoaded(datasetId: string) {
Expand Down

0 comments on commit af13e2f

Please sign in to comment.