Skip to content

Commit d32bac4

Browse files
committed
minor fixes
1 parent 4c96f78 commit d32bac4

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

components/modules/stats/BarChart.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ const buildChart = (chart, cData, onEnter, onLeave) => {
3131
const marginLeft = 36
3232
const marginAxisX = 24
3333
34-
const MIN_VALUE = d3.min([...cData.data.map((s) => s.value)])
35-
const MAX_VALUE = d3.max([...cData.data.map((s) => s.value)])
34+
const MIN_VALUE = d3.min(cData.data.map((s) => s.value))
35+
const MAX_VALUE = d3.max(cData.data.map((s) => s.value))
3636
3737
/** Scales */
3838
const xBand = d3
@@ -113,7 +113,7 @@ const buildChart = (chart, cData, onEnter, onLeave) => {
113113
d3
114114
.axisBottom(scaleX)
115115
.ticks(Math.min(cData.data.length, 6))
116-
.tickFormat(d3.timeFormat(["hour", "day"].includes(props.series.timeframe.timeframe) ? "%b %d" : "%b"))
116+
.tickFormat(d3.timeFormat(["hour", "day"].includes(props.series.timeframe.timeframe) ? "%b %d" : "%b")),
117117
)
118118
.selectAll(".tick line")
119119
.filter(function (d) {

components/modules/stats/BlocksFeed.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,15 @@ const timeline = computed(() => {
4747
return time
4848
})
4949
50-
const maxSize = computed(() => Math.max(...blocks.value?.map((b) => b.stats.bytes_in_block)))
50+
const maxSize = computed(() => {
51+
if (!blocks.value) return 0
52+
return Math.max(...blocks.value.map((b) => b.stats.bytes_in_block))
53+
})
5154
const avgBlockTime = ref(0)
5255
5356
const calculateHeight = (size) => {
5457
if (!size) return 2
55-
58+
5659
return Math.max((size / maxSize.value) * 100, 2)
5760
}
5861

components/modules/stats/LineChart.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const currentData = computed(() => {
2222
return { data: props.series.currentData }
2323
})
2424
25-
2625
const chartEl = ref()
2726
const tooltip = ref({
2827
data: [],
@@ -37,8 +36,8 @@ const buildChart = (chart, cData, onEnter, onLeave) => {
3736
const marginLeft = 36
3837
const marginAxisX = 20
3938
40-
const MIN_VALUE = d3.min([...cData.data?.map((s) => s.value)])
41-
const MAX_VALUE = d3.max([...cData.data?.map((s) => s.value)])
39+
const MIN_VALUE = d3.min(cData.data?.map((s) => s.value))
40+
const MAX_VALUE = d3.max(cData.data?.map((s) => s.value))
4241
4342
/** Scales */
4443
const x = d3.scaleUtc(
@@ -109,7 +108,7 @@ const buildChart = (chart, cData, onEnter, onLeave) => {
109108
d3
110109
.axisBottom(x)
111110
.ticks(Math.min(cData.data.length, 6))
112-
.tickFormat(d3.timeFormat(["hour", "day"].includes(props.series.timeframe.timeframe) ? "%b %d" : "%b"))
111+
.tickFormat(d3.timeFormat(["hour", "day"].includes(props.series.timeframe.timeframe) ? "%b %d" : "%b")),
113112
)
114113
115114
svg.append("g")

store/settings.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/** Vendor */
2-
import { reactive } from "vue"
32
import { defineStore, acceptHMRUpdate } from "pinia"
43

54
export const useSettingsStore = defineStore("settings", () => {

0 commit comments

Comments
 (0)