@advt-gpt-chart/package 3.0.11 → 3.0.12

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.
@@ -4,7 +4,7 @@ export declare const queryMetricId: (id: string) => Promise<any>;
4
4
  export declare const queryDimensions: (metricIds: string[]) => Promise<any>;
5
5
  export declare const queryMql2Params: (mql: any) => Promise<any>;
6
6
  export declare const queryChartData: (dataSource: DataSource, queryData: QueryData) => Promise<any>;
7
- export declare const queryParamsChartData: ({ timeRange, metrics, dimensions, timeGrain, filters, queryMetricOrgId, }: QueryData) => Promise<any>;
7
+ export declare const queryParamsChartData: ({ timeRange, metrics, dimensions, timeGrain, filters, queryMetricOrgId, queryType, }: QueryData) => Promise<any>;
8
8
  export declare const queryMqlChartData: (dataSource: DataSource, { timeRange, metrics, dimensions, timeGrain, filters, queryMetricOrgId, queryType }: QueryData) => Promise<any>;
9
9
  export declare const transformData: (params: {
10
10
  data: TableData;
package/dist/index.es.js CHANGED
@@ -60557,13 +60557,13 @@ function lg(i) {
60557
60557
  return "unknown";
60558
60558
  }
60559
60559
  function PTt(i, e) {
60560
- const t = i == null ? void 0 : i[0], n = t ? Object.keys(t) : [];
60560
+ const { data: t, metrics: n, dimensions: r } = i, o = t == null ? void 0 : t[0], a = o ? Object.keys(o) : [];
60561
60561
  return e === "cartesian" ? {
60562
- xField: n == null ? void 0 : n[0],
60563
- yField: n == null ? void 0 : n[1]
60562
+ xField: (r == null ? void 0 : r[0]) || (a == null ? void 0 : a[0]),
60563
+ yField: (n == null ? void 0 : n[0]) || (a == null ? void 0 : a[1])
60564
60564
  } : e === "polar" ? {
60565
- nameField: n == null ? void 0 : n[0],
60566
- valField: n == null ? void 0 : n[1]
60565
+ nameField: (r == null ? void 0 : r[0]) || (a == null ? void 0 : a[0]),
60566
+ valField: (n == null ? void 0 : n[0]) || (a == null ? void 0 : a[1])
60567
60567
  } : {};
60568
60568
  }
60569
60569
  const LTt = (i, e) => {
@@ -60572,7 +60572,7 @@ const LTt = (i, e) => {
60572
60572
  (e == null ? void 0 : e.type) === "rank" && (r.xField = e.yField, r.yField = e.xField);
60573
60573
  let o = Me({}, r);
60574
60574
  if (o.type = i, t === "cartesian" && n === "polar" && (o.nameField = (e == null ? void 0 : e.nameField) || e.xField, o.valField = (e == null ? void 0 : e.valField) || e.yField), t === "polar" && n === "cartesian" && (o.xField = (e == null ? void 0 : e.xField) || e.nameField, o.yField = e.yField || e.valField), t === "table") {
60575
- const a = PTt(e.data, n);
60575
+ const a = PTt(e, n);
60576
60576
  o = Me(Me({}, a), o);
60577
60577
  }
60578
60578
  return i === "rank" && (o.xField = r.yField, o.yField = r.xField), o;
@@ -61319,7 +61319,7 @@ const b2e = {
61319
61319
  }, u = (d, f) => {
61320
61320
  var p;
61321
61321
  let g = [];
61322
- return console.log("dataSourceQueryInfo", t), (p = t == null ? void 0 : t.fieldInfo) != null && p.length ? g = (t == null ? void 0 : t.fieldInfo) || [] : g = (n == null ? void 0 : n.fieldInfo) || [], JL(g, d, f);
61322
+ return (p = t == null ? void 0 : t.fieldInfo) != null && p.length ? g = (t == null ? void 0 : t.fieldInfo) || [] : g = (n == null ? void 0 : n.fieldInfo) || [], JL(g, d, f);
61323
61323
  };
61324
61324
  return { formatTime: l, getFieldType: u, formatValue: (d, f, g) => {
61325
61325
  if (!d || f === null || f === void 0)
@@ -61335,7 +61335,7 @@ const b2e = {
61335
61335
  }, getAxesType: (d) => {
61336
61336
  var p;
61337
61337
  let f = d;
61338
- console.log("fieldName", d), d != null && d.includes(zI) && (f = ((p = d == null ? void 0 : d.split(zI)) == null ? void 0 : p[0]) || f);
61338
+ d != null && d.includes(zI) && (f = ((p = d == null ? void 0 : d.split(zI)) == null ? void 0 : p[0]) || f);
61339
61339
  const g = u(f);
61340
61340
  return g === Ef.Timestamp || g === Ef.Date ? "band" : g === Ef.Number ? "linear" : "band";
61341
61341
  } };
@@ -113370,7 +113370,7 @@ function pje(i) {
113370
113370
  const p = [], m = [];
113371
113371
  n.vizSchema.fields.forEach((v) => {
113372
113372
  v.role === "dimension" && p.push(v.id), v.role === "measure" && m.push(v.id);
113373
- }), p.length > 0 && s.xField && !p.includes(s.xField) && (s.xField = p[0]), s.dimensions = p, s.metrics = m;
113373
+ }), p.length > 0 && s.xField && !p.includes(s.xField) && (s.xField = p[0]), m.length > 0 && s.yField && !m.includes(s.yField) && (s.yField = m[0]), s.dimensions = p, s.metrics = m;
113374
113374
  }
113375
113375
  return s;
113376
113376
  });
@@ -181679,7 +181679,7 @@ function qQe() {
181679
181679
  throw new Error("useGPTVisContext must be used within a GPTVisContext.Provider");
181680
181680
  return i;
181681
181681
  }
181682
- const Xxi = "3.0.11", wce = /* @__PURE__ */ Qy({});
181682
+ const Xxi = "3.0.12", wce = /* @__PURE__ */ Qy({});
181683
181683
  function YQe(i) {
181684
181684
  var e, t, n = "";
181685
181685
  if (typeof i == "string" || typeof i == "number") n += i;
@@ -183124,26 +183124,28 @@ const swi = (i) => i ? i == null ? void 0 : i.map((e) => Me({}, e.subFilter)) :
183124
183124
  dimensions: t,
183125
183125
  timeGrain: n,
183126
183126
  filters: r,
183127
- queryMetricOrgId: o
183127
+ queryMetricOrgId: o,
183128
+ queryType: a
183128
183129
  }) => {
183129
- const a = e == null ? void 0 : e.map((f) => f.value), s = a == null ? void 0 : a[0], l = t == null ? void 0 : t.some((f) => f.value === "metricTime");
183130
- let u = t, c;
183131
- l && (u = t == null ? void 0 : t.filter((f) => f.value !== "metricTime"), c = { dimensionName: "metricTime", dimensionUnit: n });
183132
- const h = {
183130
+ const s = e == null ? void 0 : e.map((g) => g.value), l = s == null ? void 0 : s[0], u = t == null ? void 0 : t.some((g) => g.value === "metricTime");
183131
+ let c = t, h;
183132
+ u && (c = t == null ? void 0 : t.filter((g) => g.value !== "metricTime"), h = { dimensionName: "metricTime", dimensionUnit: n });
183133
+ const d = {
183133
183134
  orgId: o,
183134
- metricIds: a,
183135
+ metricIds: s,
183135
183136
  timeRange: i,
183136
- dimensionIds: u == null ? void 0 : u.map((f) => f.value)
183137
+ dimensionIds: c == null ? void 0 : c.map((g) => g.value),
183138
+ queryType: a
183137
183139
  };
183138
- (i == null ? void 0 : i.type) === "custom" && (i != null && i.custom) && (h.timeRange.custom = {
183140
+ (i == null ? void 0 : i.type) === "custom" && (i != null && i.custom) && (d.timeRange.custom = {
183139
183141
  from: Lr(i.custom.from).format(vI),
183140
183142
  to: Lr(i.custom.to).format(vI)
183141
- }), c && (h.timeDimension = c), r && r.length > 0 && (h.filters = r.map((f) => ({
183143
+ }), h && (d.timeDimension = h), r && r.length > 0 && (d.filters = r.map((g) => ({
183142
183144
  conjunction: "AND",
183143
- subFilter: Me({}, f)
183145
+ subFilter: Me({}, g)
183144
183146
  })));
183145
- const d = `/metricInsight/api/v1/metric/${s}/preview`;
183146
- return WR.post({ url: d, data: h }).then((f) => (f == null ? void 0 : f.data) || []);
183147
+ const f = `/metricInsight/api/v1/metric/${l}/preview`;
183148
+ return WR.post({ url: f, data: d }).then((g) => (g == null ? void 0 : g.data) || []);
183147
183149
  }, fwi = (i, { timeRange: e, metrics: t, dimensions: n, timeGrain: r, filters: o, queryMetricOrgId: a, queryType: s }) => {
183148
183150
  const l = i == null ? void 0 : i.mql, u = {
183149
183151
  dimensions: [],
@@ -202555,6 +202557,7 @@ const t9i = ks.div`
202555
202557
  .right-content {
202556
202558
  padding-top: 16px;
202557
202559
  flex: 1;
202560
+ overflow: hidden;
202558
202561
  .advt-vis-chart-antd-form {
202559
202562
  padding: 0 8px;
202560
202563
  }
@@ -202712,6 +202715,7 @@ const t9i = ks.div`
202712
202715
  placeholder: n.formatMessage({ id: "filterConditionPlaceholder" }),
202713
202716
  value: c,
202714
202717
  height: "276px",
202718
+ width: "100%",
202715
202719
  extensions: [D5i()],
202716
202720
  onChange: (y) => h(y)
202717
202721
  }
@@ -203544,7 +203548,7 @@ function x9i({ theme: i, dataSource: e }) {
203544
203548
  filters: swi(L == null ? void 0 : L.filters),
203545
203549
  queryMetricOrgId: L == null ? void 0 : L.queryMetricOrgId
203546
203550
  };
203547
- p(F), r(L == null ? void 0 : L.metrics), a((L == null ? void 0 : L.dissionOptions) || []), console.log("controlInfo", L), u({
203551
+ p(F), r(L == null ? void 0 : L.metrics), a((L == null ? void 0 : L.dissionOptions) || []), u({
203548
203552
  metrics: (L == null ? void 0 : L.metrics) || [],
203549
203553
  dimensions: (L == null ? void 0 : L.dissionOptions) || []
203550
203554
  }), d(F);
Binary file