Skip to content

Commit

Permalink
fix: merge errors
Browse files Browse the repository at this point in the history
  • Loading branch information
islxyqwe committed Apr 1, 2024
1 parent 1f7ccee commit a32c2d4
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/graphic-walker/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export function VizAppWithContext(props: IVizAppProps & IComputationProps) {
safeMetas,
onMetaChange: safeOnMetaChange,
} = useMemo(() => {
if (props.dataSource) {
if (data) {
return {
safeMetas: fields,
computation: getComputation(data),
Expand Down
2 changes: 1 addition & 1 deletion packages/graphic-walker/src/Renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ export function RendererAppWithContext(
safeMetas,
onMetaChange: safeOnMetaChange,
} = useMemo(() => {
if (props.dataSource) {
if (data) {
return {
safeMetas: fields,
computation: getComputation(data),
Expand Down
2 changes: 1 addition & 1 deletion packages/graphic-walker/src/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export function TableAppWithContext(props: ITableProps & IComputationProps) {
safeMetas,
onMetaChange: safeOnMetaChange,
} = useMemo(() => {
if (props.dataSource) {
if (data) {
return {
safeMetas: fields,
computation: getComputation(data),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ const ChoroplethRenderer = forwardRef<IChoroplethRendererRef, IChoroplethRendere
<Tooltip>
<header>{data[i][geoId.fid]}</header>
{tooltipFields.map((f, j) => (
<TooltipContent key={j} allFields={allFields} vegaConfig={vegaConfig} field={f} value={row[f.key]} />
<TooltipContent key={j} vegaConfig={vegaConfig} field={f} value={row[f.key]} />
))}
</Tooltip>
)}
Expand All @@ -340,7 +340,7 @@ const ChoroplethRenderer = forwardRef<IChoroplethRendererRef, IChoroplethRendere
<Tooltip>
<header>{data[i][geoId.fid]}</header>
{tooltipFields.map((f, j) => (
<TooltipContent key={j} allFields={allFields} vegaConfig={vegaConfig} field={f} value={row[f.key]} />
<TooltipContent key={j} vegaConfig={vegaConfig} field={f} value={row[f.key]} />
))}
</Tooltip>
</Polygon>
Expand Down
2 changes: 1 addition & 1 deletion packages/graphic-walker/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ export interface ILocalComputationProps {
fieldKeyGuard?: boolean;
/** @deprecated renamed to data */
dataSource: any[] | Record<string, any[]>;
data?: any[];
data?: any[] | Record<string, any[]>;
computationTimeout?: number;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/graphic-walker/src/models/visSpecHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ const actions: {
},
[Methods.editAllField]: (data, fid, newData, identifier) => {
if (Object.keys(newData).includes('name')) {
const originalField = data.encodings.dimensions.concat(data.encodings.measures).find((x) => x.fid === fid);
const originalField = data.encodings.dimensions.concat(data.encodings.measures).find(identifier ? (x) => getFieldIdentifier(x) !== identifier : (x) => x.fid !== fid);
// if name is changed, update all computed fields
return produce(data, (draft) => {
if (!originalField) return;
Expand Down
3 changes: 1 addition & 2 deletions packages/graphic-walker/src/store/visualSpecStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import {
IDefaultConfig,
IJoinPath,
FieldIdentifier,
FieldIdentifier,
} from '../interfaces';
import { GLOBAL_CONFIG } from '../config';
import { COUNT_FIELD_ID, DATE_TIME_DRILL_LEVELS, DATE_TIME_FEATURE_LEVELS, PAINT_FIELD_ID, MEA_KEY_ID, MEA_VAL_ID, DEFAULT_DATASET } from '../constants';
Expand Down Expand Up @@ -582,7 +581,7 @@ export class VizSpecStore {
if (!origianlField) {
return;
}
this.visList[this.visIndex] = performers.editAllField(this.visList[this.visIndex], origianlField.fid, { name: newName });
this.visList[this.visIndex] = performers.editAllField(this.visList[this.visIndex], origianlField.fid, { name: newName }, getFieldIdentifier(origianlField));
}

public createDateTimeDrilledField(
Expand Down

0 comments on commit a32c2d4

Please sign in to comment.