Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Improve preview via API documentation #1948

Merged
merged 12 commits into from
Jan 8, 2025
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ You can also check the
- Fixed preview via API (iframe)
- Fixed cut table scroll-bars and unnecessary scroll of bar charts when
switching between chart types
- Fixed map dimension symbols to increase the elements size for small values, whilst preventing any 0 and undefined values from displaying
- Fixed map dimension symbols to increase the elements size for small values,
whilst preventing any 0 and undefined values from displaying
- Added Footer to the Profile Page
- Docs
- Added auto-generated JSON Schema files for configurator state and chart
config and improved preview charts via API documentation

# [5.0.2] - 2024-11-28

Expand Down
5 changes: 3 additions & 2 deletions app/charts/bar/bars-grouped-state-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ import {
useSegmentVariables,
} from "@/charts/shared/chart-state";
import { useRenderingKeyVariable } from "@/charts/shared/rendering-utils";
import { BarConfig, useChartConfigFilters } from "@/configurator";
import { Observation, isTemporalEntityDimension } from "@/domain/data";
import { useChartConfigFilters } from "@/config-utils";
import { BarConfig } from "@/configurator";
import { isTemporalEntityDimension, Observation } from "@/domain/data";
import { sortByIndex } from "@/utils/array";

import { ChartProps } from "../shared/ChartProps";
Expand Down
5 changes: 3 additions & 2 deletions app/charts/bar/bars-stacked-state-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ import {
useSegmentVariables,
} from "@/charts/shared/chart-state";
import { useRenderingKeyVariable } from "@/charts/shared/rendering-utils";
import { BarConfig, useChartConfigFilters } from "@/configurator";
import { Observation, isTemporalEntityDimension } from "@/domain/data";
import { useChartConfigFilters } from "@/config-utils";
import { BarConfig } from "@/configurator";
import { isTemporalEntityDimension, Observation } from "@/domain/data";
import { sortByIndex } from "@/utils/array";

import { ChartProps } from "../shared/ChartProps";
Expand Down
3 changes: 2 additions & 1 deletion app/charts/bar/bars-state-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import {
useNumericalXVariables,
} from "@/charts/shared/chart-state";
import { useRenderingKeyVariable } from "@/charts/shared/rendering-utils";
import { BarConfig, useChartConfigFilters } from "@/configurator";
import { useChartConfigFilters } from "@/config-utils";
import { BarConfig } from "@/configurator";
import { isTemporalEntityDimension } from "@/domain/data";

import { ChartProps } from "../shared/ChartProps";
Expand Down
3 changes: 2 additions & 1 deletion app/charts/bar/chart-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import {
} from "@/charts/shared/containers";
import { Tooltip } from "@/charts/shared/interaction/tooltip";
import { LegendColor } from "@/charts/shared/legend-color";
import { BarConfig, useChartConfigFilters } from "@/config-types";
import { BarConfig } from "@/config-types";
import { useChartConfigFilters } from "@/config-utils";
import { hasChartConfigs } from "@/configurator";
import { TimeSlider } from "@/configurator/interactive-filters/time-slider";
import { useConfiguratorState } from "@/src";
Expand Down
14 changes: 7 additions & 7 deletions app/charts/chart-config-ui-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import {
ComboLineSingleConfig,
ComponentType,
GenericField,
getAnimationField,
isSortingInConfig,
LineConfig,
MapConfig,
PaletteType,
Expand All @@ -37,25 +39,23 @@ import {
SortingOrder,
SortingType,
TableConfig,
getAnimationField,
isSortingInConfig,
makeMultiFilter,
} from "@/config-types";
import { makeMultiFilter } from "@/config-utils";
import { getFieldLabel } from "@/configurator/components/field-i18n";
import { mapValueIrisToColor } from "@/configurator/components/ui-helpers";
import {
ANIMATION_ENABLED_COMPONENTS,
Component,
Dimension,
MULTI_FILTER_ENABLED_COMPONENTS,
Measure,
Observation,
SEGMENT_ENABLED_COMPONENTS,
isNumericalMeasure,
isOrdinalMeasure,
isTemporalDimension,
isTemporalEntityDimension,
isTemporalOrdinalDimension,
Measure,
MULTI_FILTER_ENABLED_COMPONENTS,
Observation,
SEGMENT_ENABLED_COMPONENTS,
} from "@/domain/data";
import { getDefaultCategoricalPaletteName, getPalette } from "@/palettes";

Expand Down
3 changes: 2 additions & 1 deletion app/charts/column/chart-column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import {
} from "@/charts/shared/containers";
import { Tooltip } from "@/charts/shared/interaction/tooltip";
import { LegendColor } from "@/charts/shared/legend-color";
import { ColumnConfig, useChartConfigFilters } from "@/config-types";
import { ColumnConfig } from "@/config-types";
import { useChartConfigFilters } from "@/config-utils";
import { hasChartConfigs } from "@/configurator";
import { TimeSlider } from "@/configurator/interactive-filters/time-slider";
import { useConfiguratorState } from "@/src";
Expand Down
5 changes: 3 additions & 2 deletions app/charts/column/columns-grouped-state-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ import {
useSegmentVariables,
} from "@/charts/shared/chart-state";
import { useRenderingKeyVariable } from "@/charts/shared/rendering-utils";
import { ColumnConfig, useChartConfigFilters } from "@/configurator";
import { Observation, isTemporalEntityDimension } from "@/domain/data";
import { useChartConfigFilters } from "@/config-utils";
import { ColumnConfig } from "@/configurator";
import { isTemporalEntityDimension, Observation } from "@/domain/data";
import { sortByIndex } from "@/utils/array";

import { ChartProps } from "../shared/ChartProps";
Expand Down
5 changes: 3 additions & 2 deletions app/charts/column/columns-stacked-state-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ import {
useSegmentVariables,
} from "@/charts/shared/chart-state";
import { useRenderingKeyVariable } from "@/charts/shared/rendering-utils";
import { ColumnConfig, useChartConfigFilters } from "@/configurator";
import { Observation, isTemporalEntityDimension } from "@/domain/data";
import { useChartConfigFilters } from "@/config-utils";
import { ColumnConfig } from "@/configurator";
import { isTemporalEntityDimension, Observation } from "@/domain/data";
import { sortByIndex } from "@/utils/array";

import { ChartProps } from "../shared/ChartProps";
Expand Down
3 changes: 2 additions & 1 deletion app/charts/column/columns-state-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import {
useNumericalYVariables,
} from "@/charts/shared/chart-state";
import { useRenderingKeyVariable } from "@/charts/shared/rendering-utils";
import { ColumnConfig, useChartConfigFilters } from "@/configurator";
import { useChartConfigFilters } from "@/config-utils";
import { ColumnConfig } from "@/configurator";
import { isTemporalEntityDimension } from "@/domain/data";

import { ChartProps } from "../shared/ChartProps";
Expand Down
5 changes: 3 additions & 2 deletions app/charts/combo/combo-line-column-state-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ import {
ChartStateData,
InteractiveFiltersVariables,
RenderingVariables,
SortingVariables,
shouldUseDynamicMinScaleValue,
SortingVariables,
useBandXVariables,
useBaseVariables,
useChartData,
useInteractiveFiltersVariables,
} from "@/charts/shared/chart-state";
import { useRenderingKeyVariable } from "@/charts/shared/rendering-utils";
import { ComboLineColumnConfig, useChartConfigFilters } from "@/configurator";
import { useChartConfigFilters } from "@/config-utils";
import { ComboLineColumnConfig } from "@/configurator";

import { ChartProps } from "../shared/ChartProps";

Expand Down
8 changes: 5 additions & 3 deletions app/charts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,26 @@ import {
getDefaultCategoricalColorField,
getDefaultNumericalColorField,
} from "@/charts/map/constants";
import {
ChartConfigsAdjusters,
FieldAdjuster,
InteractiveFiltersAdjusters,
} from "@/config-adjusters";
import {
AreaSegmentField,
canBeNormalized,
ChartConfig,
ChartConfigsAdjusters,
ChartSegmentField,
ChartType,
ColumnSegmentField,
ComboChartType,
ComboLineColumnFields,
ComboLineSingleFields,
Cube,
FieldAdjuster,
Filters,
GenericField,
GenericFields,
GenericSegmentField,
InteractiveFiltersAdjusters,
InteractiveFiltersConfig,
isAreaConfig,
isColumnConfig,
Expand Down
6 changes: 4 additions & 2 deletions app/charts/map/chart-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import {
ChartControlsContainer,
} from "@/charts/shared/containers";
import { NoGeometriesHint } from "@/components/hint";
import { Cube, MapConfig, useChartConfigFilters } from "@/config-types";
import { Cube, MapConfig } from "@/config-types";
import { useChartConfigFilters } from "@/config-utils";
import { TimeSlider } from "@/configurator/interactive-filters/time-slider";
import {
dimensionValuesToGeoCoordinates,
GeoCoordinates,
GeoShapes,
dimensionValuesToGeoCoordinates,
} from "@/domain/data";
import { useDataCubesComponentsQuery } from "@/graphql/hooks";
import { getResolvedJoinById, isJoinById } from "@/graphql/join";
Expand Down Expand Up @@ -180,6 +181,7 @@ const ChartMap = memo((props: ChartMapProps) => {
const { chartConfig, dimensions, observations } = props;
const { fields } = chartConfig;
const filters = useChartConfigFilters(chartConfig);

return (
<MapChart {...props}>
<ChartContainer>
Expand Down
3 changes: 2 additions & 1 deletion app/charts/map/map-state-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import {
useBaseVariables,
useChartData,
} from "@/charts/shared/chart-state";
import { MapConfig, useChartConfigFilters } from "@/configurator";
import { useChartConfigFilters } from "@/config-utils";
import { MapConfig } from "@/configurator";
import {
GeoData,
GeoPoint,
Expand Down
3 changes: 2 additions & 1 deletion app/charts/pie/chart-pie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
import { Tooltip } from "@/charts/shared/interaction/tooltip";
import { LegendColor } from "@/charts/shared/legend-color";
import { OnlyNegativeDataHint } from "@/components/hint";
import { PieConfig, useChartConfigFilters } from "@/config-types";
import { PieConfig } from "@/config-types";
import { useChartConfigFilters } from "@/config-utils";
import { TimeSlider } from "@/configurator/interactive-filters/time-slider";

import { ChartProps, VisualizationProps } from "../shared/ChartProps";
Expand Down
3 changes: 2 additions & 1 deletion app/charts/pie/pie-state-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
useSegmentVariables,
} from "@/charts/shared/chart-state";
import { useRenderingKeyVariable } from "@/charts/shared/rendering-utils";
import { PieConfig, useChartConfigFilters } from "@/configurator";
import { useChartConfigFilters } from "@/config-utils";
import { PieConfig } from "@/configurator";

import { ChartProps } from "../shared/ChartProps";

Expand Down
4 changes: 3 additions & 1 deletion app/charts/scatterplot/chart-scatterplot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import {
import { Tooltip } from "@/charts/shared/interaction/tooltip";
import { LegendColor } from "@/charts/shared/legend-color";
import { InteractionVoronoi } from "@/charts/shared/overlay-voronoi";
import { ScatterPlotConfig, useChartConfigFilters } from "@/config-types";
import { ScatterPlotConfig } from "@/config-types";
import { useChartConfigFilters } from "@/config-utils";
import { TimeSlider } from "@/configurator/interactive-filters/time-slider";

import { ChartProps, VisualizationProps } from "../shared/ChartProps";
Expand All @@ -35,6 +36,7 @@ const ChartScatterplot = memo((props: ChartProps<ScatterPlotConfig>) => {
const { chartConfig, dimensions } = props;
const { fields, interactiveFiltersConfig } = chartConfig;
const filters = useChartConfigFilters(chartConfig);

return (
<ScatterplotChart {...props}>
<ChartContainer>
Expand Down
3 changes: 2 additions & 1 deletion app/charts/scatterplot/scatterplot-state-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
useSegmentVariables,
} from "@/charts/shared/chart-state";
import { useRenderingKeyVariable } from "@/charts/shared/rendering-utils";
import { ScatterPlotConfig, useChartConfigFilters } from "@/configurator";
import { useChartConfigFilters } from "@/config-utils";
import { ScatterPlotConfig } from "@/configurator";

import { ChartProps } from "../shared/ChartProps";

Expand Down
2 changes: 1 addition & 1 deletion app/charts/shared/chart-data-filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { Select } from "@/components/form";
import { Loading } from "@/components/hint";
import { OpenMetadataPanelWrapper } from "@/components/metadata-panel";
import SelectTree, { Tree } from "@/components/select-tree";
import { useChartConfigFilters } from "@/config-utils";
import {
areDataFiltersActive,
ChartConfig,
Expand All @@ -26,7 +27,6 @@ import {
Filters,
getFiltersByMappingStatus,
SingleFilters,
useChartConfigFilters,
useConfiguratorState,
} from "@/configurator";
import { FieldLabel, LoadingIndicator } from "@/configurator/components/field";
Expand Down
2 changes: 1 addition & 1 deletion app/charts/shared/chart-helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import {
InteractiveFiltersTimeRange,
MapConfig,
} from "@/config-types";
import { getChartConfigFilters } from "@/config-utils";
import {
CategoricalColorField,
ComboChartConfig,
DashboardFiltersConfig,
GenericField,
getChartConfigFilters,
isComboChartConfig,
NumericalColorField,
} from "@/configurator";
Expand Down
2 changes: 1 addition & 1 deletion app/charts/shared/containers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { ReactNode, useEffect, useRef } from "react";
import { useChartState } from "@/charts/shared/chart-state";
import { CalculationToggle } from "@/charts/shared/interactive-filter-calculation-toggle";
import { useObserverRef } from "@/charts/shared/use-size";
import { getChartConfig } from "@/config-utils";
import {
getChartConfig,
hasChartConfigs,
isLayoutingFreeCanvas,
useConfiguratorState,
Expand Down
8 changes: 4 additions & 4 deletions app/charts/shared/legend-color.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ import { Checkbox, CheckboxProps } from "@/components/form";
import { MaybeTooltip } from "@/components/maybe-tooltip";
import { OpenMetadataPanelWrapper } from "@/components/metadata-panel";
import { TooltipTitle } from "@/components/tooltip-utils";
import { useChartConfigFilters } from "@/config-utils";
import {
ChartConfig,
GenericSegmentField,
MapConfig,
isSegmentInConfig,
useChartConfigFilters,
MapConfig,
useReadOnlyConfiguratorState,
} from "@/configurator";
import {
Component,
Dimension,
Measure,
Observation,
isOrdinalDimension,
isOrdinalMeasure,
Measure,
Observation,
} from "@/domain/data";
import SvgIcChevronRight from "@/icons/components/IcChevronRight";
import { useChartInteractiveFilters } from "@/stores/interactive-filters";
Expand Down
2 changes: 1 addition & 1 deletion app/charts/shared/use-sync-interactive-filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
DashboardFiltersConfig,
FilterValueSingle,
isSegmentInConfig,
useChartConfigFilters,
} from "@/config-types";
import { useChartConfigFilters } from "@/config-utils";
import { parseDate } from "@/configurator/components/ui-helpers";
import { FIELD_VALUE_NONE } from "@/configurator/constants";
import useFilterChanges from "@/configurator/use-filter-changes";
Expand Down
2 changes: 1 addition & 1 deletion app/components/chart-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ import {
MetadataPanelStoreContext,
} from "@/components/metadata-panel-store";
import { BANNER_MARGIN_TOP } from "@/components/presence";
import { getChartConfig } from "@/config-utils";
import {
ChartConfig,
DataSource,
getChartConfig,
hasChartConfigs,
isConfiguring,
Layout,
Expand Down
2 changes: 1 addition & 1 deletion app/components/chart-published.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ import {
createMetadataPanelStore,
MetadataPanelStoreContext,
} from "@/components/metadata-panel-store";
import { getChartConfig } from "@/config-utils";
import {
ChartConfig,
ConfiguratorStatePublished,
DataSource,
getChartConfig,
isPublished,
useConfiguratorState,
} from "@/configurator";
Expand Down
2 changes: 1 addition & 1 deletion app/components/chart-selection-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import { DragHandle } from "@/components/drag-handle";
import Flex from "@/components/flex";
import { MenuActionItem } from "@/components/menu-action-item";
import { VisualizeTab, VisualizeTabList } from "@/components/tabs";
import { getChartConfig } from "@/config-utils";
import {
ChartConfig,
ChartType,
ConfiguratorStatePublished,
ConfiguratorStateWithChartConfigs,
getChartConfig,
hasChartConfigs,
isConfiguring,
isLayouting,
Expand Down
Loading
Loading