@malloydata/render 0.0.286 → 0.0.287

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.
@@ -1,3 +1,6 @@
1
1
  export declare const defaultSettings: {
2
2
  readonly size: "fill";
3
+ readonly line_chart: {
4
+ readonly zero_baseline: boolean;
5
+ };
3
6
  };
@@ -1,2 +1,10 @@
1
1
  import type { Tag } from '@malloydata/malloy-tag';
2
- export declare function hasAny(tag: Tag, ...paths: Array<string | string[]>): boolean;
2
+ export declare const VIZ_CHART_TYPES: string[];
3
+ /**
4
+ * Convert legacy chart tags to viz format internally.
5
+ */
6
+ export declare function convertLegacyToVizTag(tag: Tag): Tag;
7
+ /**
8
+ * Get the effective chart type from a normalized tag
9
+ */
10
+ export declare function getChartTypeFromNormalizedTag(normalizedTag: Tag): string | undefined;
@@ -138380,7 +138380,7 @@ ${spaces}}`;
138380
138380
  return new Tag(structuredClone(this));
138381
138381
  }
138382
138382
  static escapeString(str) {
138383
- return str.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
138383
+ return str.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n");
138384
138384
  }
138385
138385
  static escapeProp(str) {
138386
138386
  return str.replace(/\\/g, "\\\\").replace(/`/g, "\\`");
@@ -138838,6 +138838,13 @@ function tagFromAnnotations(annotations, prefix = "# ") {
138838
138838
  const tagLines = ((_a = annotations == null ? void 0 : annotations.map((a2) => a2.value)) == null ? void 0 : _a.filter((l2) => l2.startsWith(prefix))) ?? [];
138839
138839
  return dist$3.Tag.fromTagLines(tagLines).tag ?? new dist$3.Tag();
138840
138840
  }
138841
+ function renderTagFromAnnotations(annotations) {
138842
+ var _a, _b;
138843
+ const defaultTagLines = ((_a = annotations == null ? void 0 : annotations.map((a2) => a2.value)) == null ? void 0 : _a.filter((l2) => l2.startsWith("# "))) ?? [];
138844
+ const renderTagLines = ((_b = annotations == null ? void 0 : annotations.map((a2) => a2.value)) == null ? void 0 : _b.filter((l2) => l2.startsWith("#r "))) ?? [];
138845
+ const allLines = [...defaultTagLines, ...renderTagLines];
138846
+ return dist$3.Tag.fromTagLines(allLines).tag ?? new dist$3.Tag();
138847
+ }
138841
138848
  /* @__PURE__ */ new Map([
138842
138849
  [DurationUnit.Nanoseconds, "ns"],
138843
138850
  [DurationUnit.Microseconds, "µs"],
@@ -157485,7 +157492,8 @@ class FilterElement extends malloy_element_1$C.MalloyElement {
157485
157492
  code: this.exprSrc,
157486
157493
  e: { node: "false" },
157487
157494
  expressionType: "scalar",
157488
- fieldUsage: exprVal.fieldUsage
157495
+ fieldUsage: exprVal.fieldUsage,
157496
+ isSourceFilter: false
157489
157497
  };
157490
157498
  }
157491
157499
  const stableFilter = this.getStableFilter();
@@ -157495,7 +157503,8 @@ class FilterElement extends malloy_element_1$C.MalloyElement {
157495
157503
  e: exprVal.value,
157496
157504
  expressionType: exprVal.expressionType,
157497
157505
  fieldUsage: exprVal.fieldUsage,
157498
- stableFilter
157506
+ stableFilter,
157507
+ isSourceFilter: false
157499
157508
  };
157500
157509
  return exprCond;
157501
157510
  }
@@ -157818,6 +157827,7 @@ class Drill extends filters_1$4.Filter {
157818
157827
  const exprCond = {
157819
157828
  node: "filterCondition",
157820
157829
  code: filter2.exprSrc,
157830
+ isSourceFilter: false,
157821
157831
  e: collectedWheres === void 0 ? fExpr.value : {
157822
157832
  node: "and",
157823
157833
  kids: { left: collectedWheres, right: fExpr.value }
@@ -160329,7 +160339,10 @@ class RefinedSource extends source_1$7.Source {
160329
160339
  if ((0, malloy_types_1$u.expressionIsCalculation)(fc.expressionType)) {
160330
160340
  el.logError("aggregate-in-source-filter", "Can't use aggregate computations in top level filters");
160331
160341
  } else {
160332
- filterList.push(fc);
160342
+ filterList.push({
160343
+ ...fc,
160344
+ isSourceFilter: true
160345
+ });
160333
160346
  moreFilters = true;
160334
160347
  }
160335
160348
  }
@@ -189506,7 +189519,6 @@ function convertFieldInfos(source2, fields) {
189506
189519
  return result;
189507
189520
  }
189508
189521
  function getResultMetadataAnnotation(field2, resultMetadata) {
189509
- var _a;
189510
189522
  const tag = malloy_tag_1$1.Tag.withPrefix("#(malloy) ");
189511
189523
  let hasAny = false;
189512
189524
  if (resultMetadata.referenceId !== void 0) {
@@ -189527,9 +189539,8 @@ function getResultMetadataAnnotation(field2, resultMetadata) {
189527
189539
  hasAny = true;
189528
189540
  }
189529
189541
  }
189530
- const drillFilters = (_a = resultMetadata.filterList) === null || _a === void 0 ? void 0 : _a.filter((f2) => f2.expressionType === "scalar");
189531
- if (drillFilters) {
189532
- addDrillFiltersTag(tag, drillFilters);
189542
+ if (resultMetadata.filterList) {
189543
+ addDrillFiltersTag(tag, resultMetadata.filterList);
189533
189544
  hasAny = true;
189534
189545
  }
189535
189546
  if (resultMetadata.fieldKind === "dimension") {
@@ -189546,6 +189557,8 @@ function addDrillFiltersTag(tag, drillFilters) {
189546
189557
  var _a;
189547
189558
  for (let i = 0; i < drillFilters.length; i++) {
189548
189559
  const filter2 = drillFilters[i];
189560
+ if (filter2.expressionType !== "scalar" || filter2.isSourceFilter)
189561
+ continue;
189549
189562
  tag.set(["drill_filters", i, "code"], filter2.code);
189550
189563
  if (filter2.drillView) {
189551
189564
  tag.set(["drill_filters", i, "drill_view"], filter2.drillView);
@@ -189601,16 +189614,15 @@ function identifierCode(name) {
189601
189614
  return `\`${escapeIdentifier(name)}\``;
189602
189615
  }
189603
189616
  function getResultStructMetadataAnnotation(field2, resultMetadata) {
189604
- var _a, _b, _c;
189617
+ var _a, _b;
189605
189618
  const tag = malloy_tag_1$1.Tag.withPrefix("#(malloy) ");
189606
189619
  let hasAny = false;
189607
189620
  if (resultMetadata.limit !== void 0) {
189608
189621
  tag.set(["limit"], resultMetadata.limit);
189609
189622
  hasAny = true;
189610
189623
  }
189611
- const drillFilters = (_a = resultMetadata.filterList) === null || _a === void 0 ? void 0 : _a.filter((f2) => f2.expressionType === "scalar");
189612
- if (drillFilters) {
189613
- addDrillFiltersTag(tag, drillFilters);
189624
+ if (resultMetadata.filterList) {
189625
+ addDrillFiltersTag(tag, resultMetadata.filterList);
189614
189626
  hasAny = true;
189615
189627
  }
189616
189628
  if (resultMetadata.drillable) {
@@ -189620,8 +189632,8 @@ function getResultStructMetadataAnnotation(field2, resultMetadata) {
189620
189632
  if (resultMetadata.orderBy) {
189621
189633
  for (let i = 0; i < resultMetadata.orderBy.length; i++) {
189622
189634
  const orderBy = resultMetadata.orderBy[i];
189623
- const orderByField = typeof orderBy.field === "number" ? (_b = field2.fields[orderBy.field - 1].as) !== null && _b !== void 0 ? _b : field2.fields[orderBy.field - 1].name : orderBy.field;
189624
- const direction = (_c = orderBy.dir) !== null && _c !== void 0 ? _c : null;
189635
+ const orderByField = typeof orderBy.field === "number" ? (_a = field2.fields[orderBy.field - 1].as) !== null && _a !== void 0 ? _a : field2.fields[orderBy.field - 1].name : orderBy.field;
189636
+ const direction = (_b = orderBy.dir) !== null && _b !== void 0 ? _b : null;
189625
189637
  tag.set(["ordered_by", i, orderByField], direction);
189626
189638
  }
189627
189639
  hasAny = true;
@@ -190888,7 +190900,7 @@ var malloy = {};
190888
190900
  var version = {};
190889
190901
  Object.defineProperty(version, "__esModule", { value: true });
190890
190902
  version.MALLOY_VERSION = void 0;
190891
- version.MALLOY_VERSION = "0.0.286";
190903
+ version.MALLOY_VERSION = "0.0.287";
190892
190904
  Object.defineProperty(malloy, "__esModule", { value: true });
190893
190905
  malloy.InMemoryModelCache = malloy.CacheManager = malloy.CSVWriter = malloy.JSONWriter = malloy.DataWriter = malloy.DataRecord = malloy.DataArray = malloy.Result = malloy.ExploreMaterializer = malloy.PreparedResultMaterializer = malloy.QueryMaterializer = malloy.ModelMaterializer = malloy.SingleConnectionRuntime = malloy.ConnectionRuntime = malloy.Runtime = malloy.ExploreField = malloy.JoinRelationship = malloy.QueryField = malloy.Query = malloy.StringField = malloy.UnsupportedField = malloy.JSONField = malloy.BooleanField = malloy.NumberField = malloy.TimestampField = malloy.DateField = malloy.TimestampTimeframe = malloy.DateTimeframe = malloy.AtomicField = malloy.AtomicFieldType = malloy.Explore = malloy.SourceRelationship = malloy.FixedConnectionMap = malloy.InMemoryURLReader = malloy.EmptyURLReader = malloy.PreparedResult = malloy.DocumentCompletion = malloy.DocumentSymbol = malloy.DocumentPosition = malloy.DocumentRange = malloy.DocumentTablePath = malloy.Parse = malloy.PreparedQuery = malloy.Model = malloy.MalloyError = malloy.Malloy = void 0;
190894
190906
  const lang_1$1 = lang;
@@ -195118,6 +195130,37 @@ Object.defineProperty(connection, "__esModule", { value: true });
195118
195130
  return annotation_12.annotationToTaglines;
195119
195131
  } });
195120
195132
  })(dist$1);
195133
+ const LEGACY_CHART_TAGS = ["bar_chart", "line_chart"];
195134
+ const VIZ_CHART_TYPES = ["bar", "line"];
195135
+ function legacyTagToVizType(legacyTag) {
195136
+ const legacyMap = {
195137
+ "bar_chart": "bar",
195138
+ "line_chart": "line",
195139
+ "table": "table",
195140
+ "dashboard": "dashboard"
195141
+ };
195142
+ return legacyMap[legacyTag] ?? legacyTag;
195143
+ }
195144
+ function convertLegacyToVizTag(tag) {
195145
+ var _a;
195146
+ if (tag.has("viz")) {
195147
+ return tag;
195148
+ }
195149
+ const properties = tag.properties ?? {};
195150
+ const tagNamesInOrder = Object.keys(properties).reverse();
195151
+ const legacyChartTag = tagNamesInOrder.find(
195152
+ (name) => LEGACY_CHART_TAGS.includes(name) && !properties[name].deleted
195153
+ );
195154
+ if (legacyChartTag) {
195155
+ const legacyTagObject = tag.tag(legacyChartTag);
195156
+ tag.set(["viz"], legacyTagToVizType(legacyChartTag));
195157
+ if ((_a = tag.properties) == null ? void 0 : _a["viz"]) {
195158
+ tag.properties["viz"].properties = legacyTagObject == null ? void 0 : legacyTagObject.properties;
195159
+ }
195160
+ return tag;
195161
+ }
195162
+ return tag;
195163
+ }
195121
195164
  function getDataTree(result, plugins = []) {
195122
195165
  const fields = [];
195123
195166
  for (const field2 of result.schema.fields) {
@@ -195259,7 +195302,15 @@ const RENDER_TAG_LIST = [
195259
195302
  "segment_map"
195260
195303
  ];
195261
195304
  function shouldRenderAs(field2, parent, tagOverride) {
195262
- const tag = tagFor(field2);
195305
+ const tag = convertLegacyToVizTag(
195306
+ renderTagFromAnnotations(field2.annotations)
195307
+ );
195308
+ const vizType = tag.text("viz");
195309
+ if (vizType) {
195310
+ if (vizType === "table") return "table";
195311
+ if (vizType === "dashboard") return "dashboard";
195312
+ if (VIZ_CHART_TYPES.includes(vizType)) return "chart";
195313
+ }
195263
195314
  const properties = tag.properties ?? {};
195264
195315
  const tagNamesInOrder = Object.keys(properties).reverse();
195265
195316
  for (const tagName of tagNamesInOrder) {
@@ -195282,7 +195333,7 @@ class FieldBase {
195282
195333
  this.parent = parent;
195283
195334
  this.valueSet = /* @__PURE__ */ new Set();
195284
195335
  this._pluginData = /* @__PURE__ */ new Map();
195285
- this.tag = tagFor(this.field);
195336
+ this.tag = renderTagFromAnnotations(this.field.annotations);
195286
195337
  this.metadataTag = tagFor(this.field, "#(malloy) ");
195287
195338
  this.path = parent ? parent.isArray() ? [...parent.path] : [...parent.path, field2.name] : [];
195288
195339
  this.renderAs = shouldRenderAs(field2, parent);
@@ -138384,7 +138384,7 @@ ${spaces}}`;
138384
138384
  return new Tag(structuredClone(this));
138385
138385
  }
138386
138386
  static escapeString(str) {
138387
- return str.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
138387
+ return str.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n");
138388
138388
  }
138389
138389
  static escapeProp(str) {
138390
138390
  return str.replace(/\\/g, "\\\\").replace(/`/g, "\\`");
@@ -138842,6 +138842,13 @@ ${spaces}}`;
138842
138842
  const tagLines = ((_a = annotations == null ? void 0 : annotations.map((a2) => a2.value)) == null ? void 0 : _a.filter((l2) => l2.startsWith(prefix))) ?? [];
138843
138843
  return dist$3.Tag.fromTagLines(tagLines).tag ?? new dist$3.Tag();
138844
138844
  }
138845
+ function renderTagFromAnnotations(annotations) {
138846
+ var _a, _b;
138847
+ const defaultTagLines = ((_a = annotations == null ? void 0 : annotations.map((a2) => a2.value)) == null ? void 0 : _a.filter((l2) => l2.startsWith("# "))) ?? [];
138848
+ const renderTagLines = ((_b = annotations == null ? void 0 : annotations.map((a2) => a2.value)) == null ? void 0 : _b.filter((l2) => l2.startsWith("#r "))) ?? [];
138849
+ const allLines = [...defaultTagLines, ...renderTagLines];
138850
+ return dist$3.Tag.fromTagLines(allLines).tag ?? new dist$3.Tag();
138851
+ }
138845
138852
  /* @__PURE__ */ new Map([
138846
138853
  [DurationUnit.Nanoseconds, "ns"],
138847
138854
  [DurationUnit.Microseconds, "µs"],
@@ -157489,7 +157496,8 @@ ${left} `;
157489
157496
  code: this.exprSrc,
157490
157497
  e: { node: "false" },
157491
157498
  expressionType: "scalar",
157492
- fieldUsage: exprVal.fieldUsage
157499
+ fieldUsage: exprVal.fieldUsage,
157500
+ isSourceFilter: false
157493
157501
  };
157494
157502
  }
157495
157503
  const stableFilter = this.getStableFilter();
@@ -157499,7 +157507,8 @@ ${left} `;
157499
157507
  e: exprVal.value,
157500
157508
  expressionType: exprVal.expressionType,
157501
157509
  fieldUsage: exprVal.fieldUsage,
157502
- stableFilter
157510
+ stableFilter,
157511
+ isSourceFilter: false
157503
157512
  };
157504
157513
  return exprCond;
157505
157514
  }
@@ -157822,6 +157831,7 @@ ${left} `;
157822
157831
  const exprCond = {
157823
157832
  node: "filterCondition",
157824
157833
  code: filter2.exprSrc,
157834
+ isSourceFilter: false,
157825
157835
  e: collectedWheres === void 0 ? fExpr.value : {
157826
157836
  node: "and",
157827
157837
  kids: { left: collectedWheres, right: fExpr.value }
@@ -160333,7 +160343,10 @@ ${left} `;
160333
160343
  if ((0, malloy_types_1$u.expressionIsCalculation)(fc.expressionType)) {
160334
160344
  el.logError("aggregate-in-source-filter", "Can't use aggregate computations in top level filters");
160335
160345
  } else {
160336
- filterList.push(fc);
160346
+ filterList.push({
160347
+ ...fc,
160348
+ isSourceFilter: true
160349
+ });
160337
160350
  moreFilters = true;
160338
160351
  }
160339
160352
  }
@@ -189510,7 +189523,6 @@ ${cooked}`;
189510
189523
  return result;
189511
189524
  }
189512
189525
  function getResultMetadataAnnotation(field2, resultMetadata) {
189513
- var _a;
189514
189526
  const tag = malloy_tag_1$1.Tag.withPrefix("#(malloy) ");
189515
189527
  let hasAny = false;
189516
189528
  if (resultMetadata.referenceId !== void 0) {
@@ -189531,9 +189543,8 @@ ${cooked}`;
189531
189543
  hasAny = true;
189532
189544
  }
189533
189545
  }
189534
- const drillFilters = (_a = resultMetadata.filterList) === null || _a === void 0 ? void 0 : _a.filter((f2) => f2.expressionType === "scalar");
189535
- if (drillFilters) {
189536
- addDrillFiltersTag(tag, drillFilters);
189546
+ if (resultMetadata.filterList) {
189547
+ addDrillFiltersTag(tag, resultMetadata.filterList);
189537
189548
  hasAny = true;
189538
189549
  }
189539
189550
  if (resultMetadata.fieldKind === "dimension") {
@@ -189550,6 +189561,8 @@ ${cooked}`;
189550
189561
  var _a;
189551
189562
  for (let i2 = 0; i2 < drillFilters.length; i2++) {
189552
189563
  const filter2 = drillFilters[i2];
189564
+ if (filter2.expressionType !== "scalar" || filter2.isSourceFilter)
189565
+ continue;
189553
189566
  tag.set(["drill_filters", i2, "code"], filter2.code);
189554
189567
  if (filter2.drillView) {
189555
189568
  tag.set(["drill_filters", i2, "drill_view"], filter2.drillView);
@@ -189605,16 +189618,15 @@ ${cooked}`;
189605
189618
  return `\`${escapeIdentifier(name)}\``;
189606
189619
  }
189607
189620
  function getResultStructMetadataAnnotation(field2, resultMetadata) {
189608
- var _a, _b, _c;
189621
+ var _a, _b;
189609
189622
  const tag = malloy_tag_1$1.Tag.withPrefix("#(malloy) ");
189610
189623
  let hasAny = false;
189611
189624
  if (resultMetadata.limit !== void 0) {
189612
189625
  tag.set(["limit"], resultMetadata.limit);
189613
189626
  hasAny = true;
189614
189627
  }
189615
- const drillFilters = (_a = resultMetadata.filterList) === null || _a === void 0 ? void 0 : _a.filter((f2) => f2.expressionType === "scalar");
189616
- if (drillFilters) {
189617
- addDrillFiltersTag(tag, drillFilters);
189628
+ if (resultMetadata.filterList) {
189629
+ addDrillFiltersTag(tag, resultMetadata.filterList);
189618
189630
  hasAny = true;
189619
189631
  }
189620
189632
  if (resultMetadata.drillable) {
@@ -189624,8 +189636,8 @@ ${cooked}`;
189624
189636
  if (resultMetadata.orderBy) {
189625
189637
  for (let i2 = 0; i2 < resultMetadata.orderBy.length; i2++) {
189626
189638
  const orderBy = resultMetadata.orderBy[i2];
189627
- const orderByField = typeof orderBy.field === "number" ? (_b = field2.fields[orderBy.field - 1].as) !== null && _b !== void 0 ? _b : field2.fields[orderBy.field - 1].name : orderBy.field;
189628
- const direction = (_c = orderBy.dir) !== null && _c !== void 0 ? _c : null;
189639
+ const orderByField = typeof orderBy.field === "number" ? (_a = field2.fields[orderBy.field - 1].as) !== null && _a !== void 0 ? _a : field2.fields[orderBy.field - 1].name : orderBy.field;
189640
+ const direction = (_b = orderBy.dir) !== null && _b !== void 0 ? _b : null;
189629
189641
  tag.set(["ordered_by", i2, orderByField], direction);
189630
189642
  }
189631
189643
  hasAny = true;
@@ -190892,7 +190904,7 @@ ${cooked}`;
190892
190904
  var version = {};
190893
190905
  Object.defineProperty(version, "__esModule", { value: true });
190894
190906
  version.MALLOY_VERSION = void 0;
190895
- version.MALLOY_VERSION = "0.0.286";
190907
+ version.MALLOY_VERSION = "0.0.287";
190896
190908
  Object.defineProperty(malloy, "__esModule", { value: true });
190897
190909
  malloy.InMemoryModelCache = malloy.CacheManager = malloy.CSVWriter = malloy.JSONWriter = malloy.DataWriter = malloy.DataRecord = malloy.DataArray = malloy.Result = malloy.ExploreMaterializer = malloy.PreparedResultMaterializer = malloy.QueryMaterializer = malloy.ModelMaterializer = malloy.SingleConnectionRuntime = malloy.ConnectionRuntime = malloy.Runtime = malloy.ExploreField = malloy.JoinRelationship = malloy.QueryField = malloy.Query = malloy.StringField = malloy.UnsupportedField = malloy.JSONField = malloy.BooleanField = malloy.NumberField = malloy.TimestampField = malloy.DateField = malloy.TimestampTimeframe = malloy.DateTimeframe = malloy.AtomicField = malloy.AtomicFieldType = malloy.Explore = malloy.SourceRelationship = malloy.FixedConnectionMap = malloy.InMemoryURLReader = malloy.EmptyURLReader = malloy.PreparedResult = malloy.DocumentCompletion = malloy.DocumentSymbol = malloy.DocumentPosition = malloy.DocumentRange = malloy.DocumentTablePath = malloy.Parse = malloy.PreparedQuery = malloy.Model = malloy.MalloyError = malloy.Malloy = void 0;
190898
190910
  const lang_1$1 = lang;
@@ -195122,6 +195134,37 @@ ${errText}`, errors2);
195122
195134
  return annotation_12.annotationToTaglines;
195123
195135
  } });
195124
195136
  })(dist$1);
195137
+ const LEGACY_CHART_TAGS = ["bar_chart", "line_chart"];
195138
+ const VIZ_CHART_TYPES = ["bar", "line"];
195139
+ function legacyTagToVizType(legacyTag) {
195140
+ const legacyMap = {
195141
+ "bar_chart": "bar",
195142
+ "line_chart": "line",
195143
+ "table": "table",
195144
+ "dashboard": "dashboard"
195145
+ };
195146
+ return legacyMap[legacyTag] ?? legacyTag;
195147
+ }
195148
+ function convertLegacyToVizTag(tag) {
195149
+ var _a;
195150
+ if (tag.has("viz")) {
195151
+ return tag;
195152
+ }
195153
+ const properties = tag.properties ?? {};
195154
+ const tagNamesInOrder = Object.keys(properties).reverse();
195155
+ const legacyChartTag = tagNamesInOrder.find(
195156
+ (name) => LEGACY_CHART_TAGS.includes(name) && !properties[name].deleted
195157
+ );
195158
+ if (legacyChartTag) {
195159
+ const legacyTagObject = tag.tag(legacyChartTag);
195160
+ tag.set(["viz"], legacyTagToVizType(legacyChartTag));
195161
+ if ((_a = tag.properties) == null ? void 0 : _a["viz"]) {
195162
+ tag.properties["viz"].properties = legacyTagObject == null ? void 0 : legacyTagObject.properties;
195163
+ }
195164
+ return tag;
195165
+ }
195166
+ return tag;
195167
+ }
195125
195168
  function getDataTree(result, plugins = []) {
195126
195169
  const fields = [];
195127
195170
  for (const field2 of result.schema.fields) {
@@ -195263,7 +195306,15 @@ ${errText}`, errors2);
195263
195306
  "segment_map"
195264
195307
  ];
195265
195308
  function shouldRenderAs(field2, parent, tagOverride) {
195266
- const tag = tagFor(field2);
195309
+ const tag = convertLegacyToVizTag(
195310
+ renderTagFromAnnotations(field2.annotations)
195311
+ );
195312
+ const vizType = tag.text("viz");
195313
+ if (vizType) {
195314
+ if (vizType === "table") return "table";
195315
+ if (vizType === "dashboard") return "dashboard";
195316
+ if (VIZ_CHART_TYPES.includes(vizType)) return "chart";
195317
+ }
195267
195318
  const properties = tag.properties ?? {};
195268
195319
  const tagNamesInOrder = Object.keys(properties).reverse();
195269
195320
  for (const tagName of tagNamesInOrder) {
@@ -195286,7 +195337,7 @@ ${errText}`, errors2);
195286
195337
  this.parent = parent;
195287
195338
  this.valueSet = /* @__PURE__ */ new Set();
195288
195339
  this._pluginData = /* @__PURE__ */ new Map();
195289
- this.tag = tagFor(this.field);
195340
+ this.tag = renderTagFromAnnotations(this.field.annotations);
195290
195341
  this.metadataTag = tagFor(this.field, "#(malloy) ");
195291
195342
  this.path = parent ? parent.isArray() ? [...parent.path] : [...parent.path, field2.name] : [];
195292
195343
  this.renderAs = shouldRenderAs(field2, parent);