@bluemarble/bi 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -125,6 +125,8 @@ type BaseChartDef = {
125
125
  /** Colunas ocupadas (1 a 12). Padrão: 12. */
126
126
  span?: number;
127
127
  height?: number;
128
+ /** Aparência do card deste gráfico (sobrepõe o `cards` do layout). */
129
+ card?: CardStyle;
128
130
  };
129
131
  type ComboChartDef = BaseChartDef & {
130
132
  type: 'combo';
@@ -172,6 +174,11 @@ type TableChartDef = BaseChartDef & {
172
174
  type: 'table';
173
175
  dimensions?: string[];
174
176
  measures: string[];
177
+ /**
178
+ * Medidas com coluna de participação no total: valor da linha ÷ soma da coluna. Medida que não
179
+ * está em `measures` é consultada só para o percentual.
180
+ */
181
+ percentOf?: string[];
175
182
  /** Formatter por dimensão (`{ mes: 'nomeMes' }`). */
176
183
  formatDimensions?: Record<string, string>;
177
184
  /** Linha de total, consultada sem as dimensões (razões saem certas, não somadas). */
@@ -217,11 +224,35 @@ type CanvasDef = {
217
224
  /** Altura mínima de projeto, em px (ex.: 1080); conteúdo mais alto estende a tela. */
218
225
  height?: number;
219
226
  };
227
+ /** Moldura de um gráfico (o card): ausente = padrão do componente. */
228
+ type CardStyle = {
229
+ background?: string;
230
+ borderColor?: string;
231
+ /** Espessura da borda, em px (0 = sem borda). */
232
+ borderWidth?: number;
233
+ /** Arredondamento dos cantos, em px. */
234
+ borderRadius?: number;
235
+ /** Sombra (elevation do MUI, 0 a 24). */
236
+ shadow?: number;
237
+ /** Espaço interno, em px. */
238
+ padding?: number;
239
+ titleColor?: string;
240
+ /** Tamanho do título, em px. */
241
+ titleSize?: number;
242
+ titleAlign?: 'left' | 'center' | 'right';
243
+ };
244
+ /** Cards de todos os gráficos do layout: estilo padrão e espaço entre eles. */
245
+ type CardsStyle = CardStyle & {
246
+ /** Espaço entre os cards, em px. */
247
+ gap?: number;
248
+ };
220
249
  type ChartsLayout = {
221
250
  /** Nome do arquivo (`<layoutsDir>/<id>.json`) e chave do rascunho no devtools. */
222
251
  id: string;
223
252
  /** Ausente = responsivo (12 colunas em telas largas, um gráfico por linha no celular). */
224
253
  canvas?: CanvasDef;
254
+ /** Estilo padrão dos cards e espaço entre eles; cada gráfico sobrepõe com `card`. */
255
+ cards?: CardsStyle;
225
256
  /** Renderizados pelo `<DashboardFilters>`, na ordem. */
226
257
  filters?: FilterDef[];
227
258
  charts: ChartDef[];
@@ -230,7 +261,7 @@ type FieldSpec = {
230
261
  label: string;
231
262
  hint?: string;
232
263
  /** Agrupamento no formulário do devtools. */
233
- section: 'Gráfico' | 'Dados' | 'Aparência' | 'Filtro' | 'Tela';
264
+ section: 'Gráfico' | 'Dados' | 'Aparência' | 'Filtro' | 'Tela' | 'Card';
234
265
  required?: boolean;
235
266
  /** Valor que o componente usa quando o campo não está no JSON. */
236
267
  default?: unknown;
@@ -327,6 +358,11 @@ type DashboardDevtoolsRequest = {
327
358
  describe?: boolean;
328
359
  /** Esvazia o cache de resultados do processo antes de executar. */
329
360
  clearCache?: boolean;
361
+ /**
362
+ * Só compila: devolve o SQL e os parâmetros em `result.devtools.debug`, sem executar (o devtools
363
+ * usa para mostrar o SQL de uma consulta que deu erro).
364
+ */
365
+ compile?: boolean;
330
366
  /** Devolve o `EXPLAIN` da consulta em vez das linhas. */
331
367
  explain?: boolean;
332
368
  /** Mede a agregação de cada fato usada pela consulta, isoladamente. */
@@ -449,5 +485,5 @@ type DashboardResult = {
449
485
  };
450
486
  };
451
487
  //#endregion
452
- export { layoutModelWarnings as A, ModelDef as B, ComboChartDef as C, FilterDef as D, FieldSpec as E, DimensionDef as F, TableDef as G, RatioMeasure as H, FieldMeta as I, validateModel as J, ValueFormat as K, FormulaMeasure as L, validateLayout as M, AggregateMeasure as N, KpiChartDef as O, Aggregation as P, MeasureDef as R, ChartsLayout as S, DonutChartDef as T, RelationshipDef as U, ModelMeta as V, SumMeasure as W, CanvasDef as _, DashboardResult as a, ChartTypeSpec as b, DevtoolsCapabilities as c, ModelValidation as d, ProfileStep as f, BuiltinChartDef as g, BarChartDef as h, DashboardQueryDebug as i, resolveChartTypes as j, TableChartDef as k, FilterValue as l, SchemaTable as m, DashboardFilters as n, DashboardRow as o, SaveModelResult as p, modelMeta as q, DashboardQuery as r, DashboardSnapshot as s, DashboardDevtoolsRequest as t, ModelColumns as u, ChartDef as v, CustomChartDef as w, ChartTypes as x, ChartType as y, MeasureMeta as z };
453
- //# sourceMappingURL=types-BO_AQNxv.d.ts.map
488
+ export { KpiChartDef as A, MeasureDef as B, ChartTypes as C, DonutChartDef as D, CustomChartDef as E, AggregateMeasure as F, RelationshipDef as G, ModelDef as H, Aggregation as I, ValueFormat as J, SumMeasure as K, DimensionDef as L, layoutModelWarnings as M, resolveChartTypes as N, FieldSpec as O, validateLayout as P, FieldMeta as R, ChartTypeSpec as S, ComboChartDef as T, ModelMeta as U, MeasureMeta as V, RatioMeasure as W, validateModel as X, modelMeta as Y, CanvasDef as _, DashboardResult as a, ChartDef as b, DevtoolsCapabilities as c, ModelValidation as d, ProfileStep as f, BuiltinChartDef as g, BarChartDef as h, DashboardQueryDebug as i, TableChartDef as j, FilterDef as k, FilterValue as l, SchemaTable as m, DashboardFilters as n, DashboardRow as o, SaveModelResult as p, TableDef as q, DashboardQuery as r, DashboardSnapshot as s, DashboardDevtoolsRequest as t, ModelColumns as u, CardStyle as v, ChartsLayout as w, ChartType as x, CardsStyle as y, FormulaMeasure as z };
489
+ //# sourceMappingURL=types-DUJS2Zmx.d.ts.map
package/dist/types.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { B as ModelDef, C as ComboChartDef, D as FilterDef, E as FieldSpec, F as DimensionDef, G as TableDef, I as FieldMeta, K as ValueFormat, L as FormulaMeasure, O as KpiChartDef, R as MeasureDef, S as ChartsLayout, T as DonutChartDef, U as RelationshipDef, V as ModelMeta, _ as CanvasDef, a as DashboardResult, b as ChartTypeSpec, c as DevtoolsCapabilities, d as ModelValidation, f as ProfileStep, g as BuiltinChartDef, h as BarChartDef, i as DashboardQueryDebug, k as TableChartDef, l as FilterValue, m as SchemaTable, n as DashboardFilters, o as DashboardRow, p as SaveModelResult, r as DashboardQuery, s as DashboardSnapshot, t as DashboardDevtoolsRequest, u as ModelColumns, v as ChartDef, w as CustomChartDef, x as ChartTypes, y as ChartType, z as MeasureMeta } from "./types-BO_AQNxv.js";
2
- export { type BarChartDef, type BuiltinChartDef, type CanvasDef, type ChartDef, type ChartType, type ChartTypeSpec, type ChartTypes, type ChartsLayout, type ComboChartDef, type CustomChartDef, DashboardDevtoolsRequest, DashboardFilters, DashboardQuery, DashboardQueryDebug, DashboardResult, DashboardRow, DashboardSnapshot, DevtoolsCapabilities, type DimensionDef, type DonutChartDef, type FieldMeta, type FieldSpec, type FilterDef, FilterValue, type FormulaMeasure, type KpiChartDef, type MeasureDef, type MeasureMeta, ModelColumns, type ModelDef, type ModelMeta, ModelValidation, ProfileStep, type RelationshipDef, SaveModelResult, SchemaTable, type TableChartDef, type TableDef, type ValueFormat };
1
+ import { A as KpiChartDef, B as MeasureDef, C as ChartTypes, D as DonutChartDef, E as CustomChartDef, G as RelationshipDef, H as ModelDef, J as ValueFormat, L as DimensionDef, O as FieldSpec, R as FieldMeta, S as ChartTypeSpec, T as ComboChartDef, U as ModelMeta, V as MeasureMeta, _ as CanvasDef, a as DashboardResult, b as ChartDef, c as DevtoolsCapabilities, d as ModelValidation, f as ProfileStep, g as BuiltinChartDef, h as BarChartDef, i as DashboardQueryDebug, j as TableChartDef, k as FilterDef, l as FilterValue, m as SchemaTable, n as DashboardFilters, o as DashboardRow, p as SaveModelResult, q as TableDef, r as DashboardQuery, s as DashboardSnapshot, t as DashboardDevtoolsRequest, u as ModelColumns, v as CardStyle, w as ChartsLayout, x as ChartType, y as CardsStyle, z as FormulaMeasure } from "./types-DUJS2Zmx.js";
2
+ export { type BarChartDef, type BuiltinChartDef, type CanvasDef, type CardStyle, type CardsStyle, type ChartDef, type ChartType, type ChartTypeSpec, type ChartTypes, type ChartsLayout, type ComboChartDef, type CustomChartDef, DashboardDevtoolsRequest, DashboardFilters, DashboardQuery, DashboardQueryDebug, DashboardResult, DashboardRow, DashboardSnapshot, DevtoolsCapabilities, type DimensionDef, type DonutChartDef, type FieldMeta, type FieldSpec, type FilterDef, FilterValue, type FormulaMeasure, type KpiChartDef, type MeasureDef, type MeasureMeta, ModelColumns, type ModelDef, type ModelMeta, ModelValidation, ProfileStep, type RelationshipDef, SaveModelResult, SchemaTable, type TableChartDef, type TableDef, type ValueFormat };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluemarble/bi",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
4
4
  "description": "Camada semântica (defineModel) + componentes de dashboard e devtools para substituir o Power BI",
5
5
  "license": "MIT",
6
6
  "author": "bluemarble",
@@ -62,6 +62,7 @@
62
62
  "peerDependencies": {
63
63
  "@mui/material": "^7",
64
64
  "react": "^19",
65
+ "react-dom": "^19",
65
66
  "recharts": "^3"
66
67
  },
67
68
  "overrides": {