Skip to content

Commit

Permalink
fix: correct spelling of DonutChartConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
UmakanthKaspa committed Dec 23, 2024
1 parent d9a6638 commit 681ff26
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions frontend/src2/charts/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getCachedQuery, makeQuery, Query } from '../query/query'
import {
AXIS_CHARTS,
AxisChartConfig,
DountChartConfig,
DonutChartConfig,
NumberChartConfig,
TableChartConfig
} from '../types/chart.types'
Expand Down Expand Up @@ -93,7 +93,7 @@ function makeChart(workbookChart: WorkbookChart) {
const _config = unref(chart.doc.config as NumberChartConfig)
prepared = prepareNumberChartQuery(_config)
} else if (chart.doc.chart_type === 'Donut' || chart.doc.chart_type === 'Funnel') {
const _config = unref(chart.doc.config as DountChartConfig)
const _config = unref(chart.doc.config as DonutChartConfig)
prepared = prepareDonutChartQuery(_config)
} else if (chart.doc.chart_type === 'Table') {
const _config = unref(chart.doc.config as TableChartConfig)
Expand Down Expand Up @@ -174,7 +174,7 @@ function makeChart(workbookChart: WorkbookChart) {
return true
}

function prepareDonutChartQuery(config: DountChartConfig) {
function prepareDonutChartQuery(config: DonutChartConfig) {
if (!config.label_column) {
console.warn('Label is required')
chart.dataQuery.reset()
Expand Down
4 changes: 2 additions & 2 deletions frontend/src2/charts/components/ChartConfigForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { computed } from 'vue'
import {
BarChartConfig,
DountChartConfig,
DonutChartConfig,
FunnelChartConfig,
LineChartConfig,
NumberChartConfig,
Expand Down Expand Up @@ -41,7 +41,7 @@ const columnOptions = computed(() => {
/>
<DonutChartConfigForm
v-if="props.chart.doc.chart_type == 'Donut'"
v-model="(props.chart.doc.config as DountChartConfig)"
v-model="(props.chart.doc.config as DonutChartConfig)"
:dimensions="dimensions"
:column-options="columnOptions"
/>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src2/charts/components/ChartRenderer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { computed, ref } from 'vue'
import {
BarChartConfig,
ChartType,
DountChartConfig,
DonutChartConfig,
FunnelChartConfig,
LineChartConfig,
NumberChartConfig,
Expand Down Expand Up @@ -45,7 +45,7 @@ const eChartOptions = computed(() => {
return getLineChartOptions(props.config as LineChartConfig, props.result)
}
if (props.chart_type === 'Donut') {
return getDonutChartOptions(props.config as DountChartConfig, props.result)
return getDonutChartOptions(props.config as DonutChartConfig, props.result)
}
if (props.chart_type === 'Funnel') {
return getFunnelChartOptions(props.config as FunnelChartConfig, props.result)
Expand Down
4 changes: 2 additions & 2 deletions frontend/src2/charts/components/DonutChartConfigForm.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, watchEffect } from 'vue'
import { FIELDTYPES } from '../../helpers/constants'
import { DountChartConfig } from '../../types/chart.types'
import { DonutChartConfig } from '../../types/chart.types'
import { ColumnOption, Dimension, DimensionOption, Measure } from '../../types/query.types'
import CollapsibleSection from './CollapsibleSection.vue'
import DimensionPicker from './DimensionPicker.vue'
Expand All @@ -12,7 +12,7 @@ const props = defineProps<{
columnOptions: ColumnOption[]
}>()
const config = defineModel<DountChartConfig>({
const config = defineModel<DonutChartConfig>({
required: true,
default: () => ({
label_column: {},
Expand Down
6 changes: 3 additions & 3 deletions frontend/src2/charts/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
AxisChartConfig,
BarChartConfig,
ChartConfig,
DountChartConfig,
DonutChartConfig,
LineChartConfig,
Series,
SeriesLine,
Expand Down Expand Up @@ -295,7 +295,7 @@ function getYAxis(options: YAxisCustomizeOptions = {}) {
}
}

export function getDonutChartOptions(config: DountChartConfig, result: QueryResult) {
export function getDonutChartOptions(config: DonutChartConfig, result: QueryResult) {
const columns = result.columns
const rows = result.rows

Expand Down Expand Up @@ -442,7 +442,7 @@ function getDonutChartData(
return topData
}

export function getFunnelChartOptions(config: DountChartConfig, result: QueryResult) {
export function getFunnelChartOptions(config: DonutChartConfig, result: QueryResult) {
const rows = result.rows

const labelColumn = config.label_column.dimension_name
Expand Down
4 changes: 2 additions & 2 deletions frontend/src2/types/chart.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export type NumberColumnOptions = {
suffix?: string
}

export type DountChartConfig = {
export type DonutChartConfig = {
label_column: Dimension
value_column: Measure
legend_position?: 'top' | 'bottom' | 'left' | 'right'
Expand All @@ -100,4 +100,4 @@ export type TableChartConfig = {
enable_color_scale?: boolean
}

export type ChartConfig = LineChartConfig | BarChartConfig | NumberChartConfig | DountChartConfig | TableChartConfig | FunnelChartConfig
export type ChartConfig = LineChartConfig | BarChartConfig | NumberChartConfig | DonutChartConfig | TableChartConfig | FunnelChartConfig

0 comments on commit 681ff26

Please sign in to comment.