Skip to content

Commit

Permalink
feat(heatmap): Heatmap learned flipAxes true/false, to flip the heatm…
Browse files Browse the repository at this point in the history
…ap :-)
  • Loading branch information
billyc committed Dec 9, 2021
1 parent bbcd737 commit 5aa3c07
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 7 deletions.
126 changes: 126 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"maplibre-gl": ">=1.14.0",
"markdown-it": "^12.2.0",
"marked": "^0.8.0",
"mathjs": "^10.0.0",
"medium-zoom": "^1.0.5",
"micromatch": "^4.0.2",
"moment": "^2.24.0",
Expand Down
13 changes: 6 additions & 7 deletions src/charts/heatmap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ VuePlotly.myplot(

<script lang="ts">
import { Vue, Component, Watch, Prop } from 'vue-property-decorator'
import { transpose } from 'mathjs'
import VuePlotly from '@/components/VuePlotly.vue'
import DashboardDataManager from '@/js/DashboardDataManager'
Expand Down Expand Up @@ -126,11 +127,13 @@ export default class VueComponent extends Vue {
subMatrix = []
}
if (this.config.flipAxes) matrix = transpose(matrix)
// Pushes the data into the chart
this.data = [
{
x: xaxis,
y: yaxis,
x: this.config.flipAxes ? yaxis : xaxis,
y: this.config.flipAxes ? xaxis : yaxis,
z: matrix,
colorscale: 'Viridis', // 'YlOrRed', // 'Hot',
type: 'heatmap',
Expand All @@ -140,11 +143,7 @@ export default class VueComponent extends Vue {
}
private layout: any = {
height: 300,
width: 0,
margin: { t: 30, b: 50, l: 60, r: 20 },
//automargin: true,
//legend: { orientation: 'h' }, // , yanchor: 'bottom', y: -0.4 },
margin: { t: 8, b: 50 },
font: {
color: '#444444',
family: UI_FONT,
Expand Down

0 comments on commit 5aa3c07

Please sign in to comment.