Skip to content

Commit

Permalink
fix: attempt to fix temp chart issues (#551)
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Lamas <[email protected]>
  • Loading branch information
pedrolamas authored Mar 1, 2022
1 parent 1139c2a commit 5ba5160
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 91 deletions.
151 changes: 96 additions & 55 deletions package-lock.json

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

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@
"core-js": "^3.14.0",
"dayjs": "^1.10.5",
"deepmerge": "^4.2.2",
"echarts": "^5.1.2",
"echarts-for-vue": "^1.4.1",
"echarts-gl": "^2.0.6",
"echarts": "^5.3.0",
"echarts-gl": "^2.0.9",
"jwt-decode": "^3.1.2",
"lodash": "^4.17.21",
"md5": "^2.3.0",
Expand All @@ -60,6 +59,7 @@
"vue": "^2.6.14",
"vue-class-component": "^7.2.3",
"vue-debounce-decorator": "^1.0.1",
"vue-echarts": "^6.0.2",
"vue-headful": "^2.1.0",
"vue-i18n": "^8.24.5",
"vue-inline-svg": "^2.0.0",
Expand Down Expand Up @@ -91,6 +91,7 @@
"@vue/cli-plugin-unit-jest": "^4.5.13",
"@vue/cli-plugin-vuex": "^4.5.13",
"@vue/cli-service": "^4.5.13",
"@vue/composition-api": "^1.4.9",
"@vue/eslint-config-standard": "^5.1.2",
"@vue/eslint-config-typescript": "^5.0.2",
"@vue/test-utils": "^1.2.1",
Expand Down
15 changes: 8 additions & 7 deletions src/components/ui/AppChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@
class="chart"
:style="{ 'height': height }"
>
<ECharts
<v-chart
v-if="ready"
style="overflow: initial;"
ref="chart"
:option="opts"
:setOptionOps="{ notMerge: true }"
:initOpts="{ renderer: 'svg' }"
:update-options="{ notMerge: true }"
:init-options="{ renderer: 'svg' }"
:events="events"
>
</ECharts>
</v-chart>
</div>
</div>
</template>

<script lang='ts'>
import { Vue, Component, Prop, Watch, Ref } from 'vue-property-decorator'
import { ECharts } from 'echarts'
import { merge } from 'lodash'
@Component({})
Expand All @@ -37,7 +38,7 @@ export default class AppChart extends Vue {
events!: any;
@Ref('chart')
chart!: any
chart!: ECharts
ready = false
Expand All @@ -52,7 +53,7 @@ export default class AppChart extends Vue {
@Watch('data')
onData (data: any) {
if (this.chart && data && data.length) {
this.chart.inst.setOption({
this.chart.setOption({
dataset: {
source: data
}
Expand Down Expand Up @@ -81,7 +82,7 @@ export default class AppChart extends Vue {
beforeDestroy () {
if (typeof window === 'undefined') return
if (this.chart) {
this.chart.inst.dispose()
this.chart.dispose()
}
}
}
Expand Down
16 changes: 7 additions & 9 deletions src/components/widgets/bedmesh/BedMeshChart.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<template>
<div class="chart" :style="{ 'height': height }">
<ECharts
<v-chart
ref="chart"
:option="opts"
:setOptionOps="{ notMerge: false }"
:initOpts="{ renderer: 'canvas' }"
:update-options="{ notMerge: false }"
:init-options="{ renderer: 'canvas' }"
>
</ECharts>
</v-chart>

<!-- <pre>legends: {{ opts.legend }}</pre> -->

Expand All @@ -15,7 +15,7 @@
</template>

<script lang='ts'>
import { Vue, Component, Prop, Watch } from 'vue-property-decorator'
import { Vue, Component, Prop, Watch, Ref } from 'vue-property-decorator'
import { ECharts } from 'echarts'
import { merge } from 'lodash'
Expand All @@ -30,10 +30,8 @@ export default class EChartsBedMesh extends Vue {
@Prop({ type: String, default: '100%' })
height!: string;
get chart () {
const ref = this.$refs.chart as any
if (ref) return ref.inst as ECharts
}
@Ref('chart')
chart!: ECharts
get flatSurface () {
return this.$store.state.mesh.flatSurface
Expand Down
Loading

0 comments on commit 5ba5160

Please sign in to comment.