feat(superset): подача дашборда «Бизнес-сюжеты»

- Зачем:
  - экран отвечал только графиками: итога за период не было, доли категорий
    читались по высоте столбиков, а известные пользователи лежали на нуле
    рядом с посетителями.
- Что:
  - добавлены ряд крупных чисел (выручка, заказы, средний чек, посетители),
    кольцо долей категорий и линия доли известных пользователей;
  - средний чек и доля известных заведены метриками датасетов, знаменатель
    через `nullIf`: на пустом периоде деление Decimal на ноль в ClickHouse
    роняет панель;
  - фильтр «Период» сужает все панели, включая сверку по `order_day`;
  - `label_colors` закрепляет цвет за категорией и за рядами трафика;
  - деньги без копеек, единица в названии панели; подписи дат читаются как
    даты; сводная сверки развернута классами по строкам и уместилась без
    прокрутки;
  - обновлены справочник Superset и глава путеводителя.
- Проверка:
  - `make lint`;
  - `superset import-directory /app/import --overwrite` на живом стенде, экран
    снят в браузере: девять панелей отрисованы, цвет категории одинаков на
    столбиках и в кольце;
  - период 03.06–06.06 сузил все панели, включая сводную по `order_day`;
  - `SUM(revenue) / nullIf(SUM(orders), 0)` на периоде без заказов возвращает
    NULL, без `nullIf` — исключение 153.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ddadminandClaude Opus 5 committed 2026-09-08 03:35:00 -04:00
1 parent 3ad377e02e
commit b6c10ecf21
14 files changed
+378 -32

No files matched your search

@@ -0,0 +1,19 @@
slice_name: Средний чек, ₽
description: null
certified_by: null
certification_details: null
viz_type: big_number_total
params:
viz_type: big_number_total
metric: avg_check
adhoc_filters:
- expressionType: SIMPLE
subject: report_date
operator: TEMPORAL_RANGE
comparator: No filter
clause: WHERE
header_font_size: 0.3
cache_timeout: null
uuid: 19600000-0000-4000-8000-000000000106
version: 1.0.0
dataset_uuid: 19600000-0000-4000-8000-000000000001
@@ -0,0 +1,19 @@
slice_name: Заказы
description: null
certified_by: null
certification_details: null
viz_type: big_number_total
params:
viz_type: big_number_total
metric: orders
adhoc_filters:
- expressionType: SIMPLE
subject: report_date
operator: TEMPORAL_RANGE
comparator: No filter
clause: WHERE
header_font_size: 0.3
cache_timeout: null
uuid: 19600000-0000-4000-8000-000000000105
version: 1.0.0
dataset_uuid: 19600000-0000-4000-8000-000000000001
@@ -0,0 +1,19 @@
slice_name: Выручка, ₽
description: null
certified_by: null
certification_details: null
viz_type: big_number_total
params:
viz_type: big_number_total
metric: revenue
adhoc_filters:
- expressionType: SIMPLE
subject: report_date
operator: TEMPORAL_RANGE
comparator: No filter
clause: WHERE
header_font_size: 0.3
cache_timeout: null
uuid: 19600000-0000-4000-8000-000000000104
version: 1.0.0
dataset_uuid: 19600000-0000-4000-8000-000000000001
@@ -0,0 +1,19 @@
slice_name: Посетители
description: null
certified_by: null
certification_details: null
viz_type: big_number_total
params:
viz_type: big_number_total
metric: visitors
adhoc_filters:
- expressionType: SIMPLE
subject: report_date
operator: TEMPORAL_RANGE
comparator: No filter
clause: WHERE
header_font_size: 0.3
cache_timeout: null
uuid: 19600000-0000-4000-8000-000000000107
version: 1.0.0
dataset_uuid: 19600000-0000-4000-8000-000000000003
@@ -0,0 +1,31 @@
slice_name: Доля известных пользователей
description: null
certified_by: null
certification_details: null
viz_type: echarts_timeseries_line
params:
viz_type: echarts_timeseries_line
x_axis: report_date
metrics:
- known_share
groupby: []
adhoc_filters:
- expressionType: SIMPLE
subject: report_date
operator: TEMPORAL_RANGE
comparator: No filter
clause: WHERE
row_limit: 10000
seriesType: line
show_legend: false
rich_tooltip: true
show_value: false
markerEnabled: true
markerSize: 6
y_axis_format: .1%
x_axis_time_format: '%d.%m'
tooltipTimeFormat: '%d.%m.%Y'
cache_timeout: null
uuid: 19600000-0000-4000-8000-000000000109
version: 1.0.0
dataset_uuid: 19600000-0000-4000-8000-000000000003
@@ -6,9 +6,9 @@ viz_type: pivot_table_v2
params:
viz_type: pivot_table_v2
groupbyRows:
- order_day
groupbyColumns:
- mismatch_class
groupbyColumns:
- order_day
metrics:
- order_count
adhoc_filters:
@@ -23,8 +23,7 @@ params:
colOrder: key_a_to_z
order_desc: true
row_limit: 10000
valueFormat: SMART_NUMBER
date_format: smart_date
date_format: '%d.%m.%Y'
cache_timeout: null
uuid: 19600000-0000-4000-8000-000000000102
version: 1.0.0
@@ -1,4 +1,4 @@
slice_name: Выручка по дням и категориям
slice_name: Выручка по дням и категориям, ₽
description: null
certified_by: null
certification_details: null
@@ -20,10 +20,13 @@ params:
stack: Stack
orientation: vertical
show_legend: true
legendType: plain
legendOrientation: bottom
rich_tooltip: true
show_value: false
y_axis_format: ',.2f'
x_axis_time_format: smart_date
y_axis_format: ',d'
x_axis_time_format: '%d.%m'
tooltipTimeFormat: '%d.%m.%Y'
cache_timeout: null
uuid: 19600000-0000-4000-8000-000000000101
version: 1.0.0
@@ -0,0 +1,29 @@
slice_name: Доля категорий в выручке
description: null
certified_by: null
certification_details: null
viz_type: pie
params:
viz_type: pie
groupby:
- product_category
metric: revenue
adhoc_filters:
- expressionType: SIMPLE
subject: report_date
operator: TEMPORAL_RANGE
comparator: No filter
clause: WHERE
row_limit: 10000
sort_by_metric: true
donut: true
innerRadius: 30
outerRadius: 70
show_labels: true
labels_outside: false
label_type: percent
show_legend: false
cache_timeout: null
uuid: 19600000-0000-4000-8000-000000000108
version: 1.0.0
dataset_uuid: 19600000-0000-4000-8000-000000000001
@@ -17,12 +17,16 @@ params:
comparator: No filter
clause: WHERE
row_limit: 10000
seriesType: echarts_timeseries_line
seriesType: line
show_legend: true
legendOrientation: bottom
rich_tooltip: true
show_value: false
markerEnabled: true
markerSize: 6
y_axis_format: ',d'
x_axis_time_format: smart_date
x_axis_time_format: '%d.%m'
tooltipTimeFormat: '%d.%m.%Y'
cache_timeout: null
uuid: 19600000-0000-4000-8000-000000000103
version: 1.0.0