Skip to content

Commit

Permalink
Fix: display pct bar in dimension table (#6258)
Browse files Browse the repository at this point in the history
  • Loading branch information
djbarnwal authored Dec 11, 2024
1 parent c262763 commit d95acaa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@
instanceId,
metricsViewName,
{
measures: [{ name: activeMeasureName }],
measures: visibleMeasureNames.map((measureName) => ({
name: measureName,
})),
where: sanitiseExpression(
mergeDimensionAndMeasureFilter(
getFiltersForOtherDimensions(whereFilter, dimensionName),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import type { VirtualizedTableColumns } from "@rilldata/web-common/components/virtualized-table/types";
import type {
MetricsViewSpecDimensionV2,
RpcStatus,
V1MetricsViewAggregationResponse,
V1MetricsViewTotalsResponse,
} from "@rilldata/web-common/runtime-client";
import type { DashboardDataSources } from "./types";
import type { QueryObserverResult } from "@tanstack/svelte-query";
import { isSummableMeasure } from "../../dashboard-utils";
import type { DimensionTableRow } from "../../dimension-table/dimension-table-types";
import {
prepareDimensionTableRows,
prepareVirtualizedDimTableColumns,
} from "../../dimension-table/dimension-table-utils";
import { allMeasures, visibleMeasures } from "./measures";
import type { QueryObserverResult } from "@tanstack/svelte-query";
import { isSummableMeasure } from "../../dashboard-utils";
import { isTimeComparisonActive } from "./time-range";
import { activeMeasureName, isValidPercentOfTotal } from "./active-measure";
import { selectedDimensionValues } from "./dimension-filters";
import type { DimensionTableRow } from "../../dimension-table/dimension-table-types";
import type { VirtualizedTableColumns } from "@rilldata/web-common/components/virtualized-table/types";
import { allMeasures, visibleMeasures } from "./measures";
import { isTimeComparisonActive } from "./time-range";
import type { DashboardDataSources } from "./types";

export const selectedDimensionValueNames = (
dashData: DashboardDataSources,
Expand Down Expand Up @@ -55,7 +55,7 @@ export const virtualizedTableColumns =
if (totalsQuery?.data?.data) {
measures.map((m) => {
if (m.name && isSummableMeasure(m)) {
measureTotals[m.name] = totalsQuery.data?.data?.[m.name];
measureTotals[m.name] = totalsQuery.data?.data?.[0]?.[m.name];
}
});
}
Expand Down

1 comment on commit d95acaa

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.