Skip to content

Commit

Permalink
Merge pull request #89 from VisActor/feat/text-editor
Browse files Browse the repository at this point in the history
fix: fix issue with text and mark edit
  • Loading branch information
neuqzxy authored Oct 12, 2024
2 parents 1619659 + 9a16fb1 commit f8388f4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 3 deletions.
8 changes: 7 additions & 1 deletion packages/vstory/demo/src/demos/API.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,18 @@ export const API = () => {
fill: 'black',
text: 'black',
symbolType: 'circle'
},
group: {
fill: 'red',
visible: true
}
}
});

text.setConfig({ options: { graphic: { text: '这是普通文本' } } });
console.log(text);
setTimeout(() => {
text.setConfig({ options: { group: { visible: false } } });
}, 1000);

chart.setConfig({ zIndex: 100 });

Expand Down
2 changes: 1 addition & 1 deletion packages/vstory/demo/src/demos/VChartGraphic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ loadAllSelection();
Edit.registerEditComponent('text', TextSelection);
// Edit.registerEditComponent('richtext', RichTextSelection);
Edit.registerEditComponent('box-selection', BoxSelection);
Edit.registerEditComponent('series-mark-selection', SeriesMarkSelection);
// Edit.registerEditComponent('series-mark-selection', SeriesMarkSelection);

const spec = {
direction: 'vertical',
Expand Down
2 changes: 2 additions & 0 deletions packages/vstory/src/edit/edit-component/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ChartSelection } from './chart-selection';
import { Edit } from '../edit';
import { ShapeSelection } from './shape-selection';
import { TextSelection } from './text-selection';
import { SeriesMarkSelection } from './series-mark/series-mark-selection';
// import { RichTextSelection } from './richtext-selection';

export function loadAllSelection() {
Expand All @@ -17,4 +18,5 @@ export function loadAllSelection() {
Edit.registerEditComponent('shape', ShapeSelection);
Edit.registerEditComponent('chart', ChartSelection);
Edit.registerEditComponent('box-selection', BoxSelection);
Edit.registerEditComponent('series-mark-selection', SeriesMarkSelection);
}
1 change: 1 addition & 0 deletions packages/vstory/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ export * from './story/interface/index';
export * from './story/character';
export * from './template/unit';
export * from './edit/edit-component';
export { RichTextEditPlugin } from '@visactor/vrender-core';
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export class CharacterComponentText extends CharacterComponent {
this._group = new ComponentGroup({
...getLayoutFromWidget(this._config.position),
// angle: this._config.options.angle,
zIndex: this._config.zIndex
zIndex: this._config.zIndex,
...(this._config.options.group || {})
});
this.option.graphicParent.add(this._group);

Expand Down
1 change: 1 addition & 0 deletions packages/vstory/src/story/character/dsl-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export type IEditorTextGraphicAttribute = {
export interface IComponentCharacterConfig extends ICharacterConfigBase {
options: {
graphic: any;
group?: any;
text?: IEditorTextGraphicAttribute;
isResized?: boolean;
// angle?: number;
Expand Down

0 comments on commit f8388f4

Please sign in to comment.