-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gi-sdk): basic graph application rendering using gi-sdk #540
Conversation
</Graphin> | ||
</div> | ||
<Panel>{snap.isReady && renderComponent('panel')}</Panel> | ||
<Panel>{isReady && renderComponents('panel')}</Panel> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SDK 里是默认内置一个布局吗,可以实现自定义其他布局吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
福老师初版实现是内置的布局,之前设计 spec 的时候有考虑过自定义布局吗?有的话,后面可以加这个 feature~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哦,咋们这次升级是为了解决啥,slot 的设计和设计 spec 不太一样 @hustcc,后面升级可能是 breakchange
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
经讨论,还是之前的spec设计更符合 sdk 的定位,下个 pr 进行修改~
/** | ||
* The widgets related to the graph. | ||
*/ | ||
widgets: WidgetItem[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dataset 的设计,目前还是采用挂载到 window 的方案吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看了下 dataset 的类型定义对应的是一套服务的配置参数,调用服务获取数据的逻辑打算放在上层应用,gisdk专注于渲染图应用。这样设计可行吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
数据的定义和获取,是业务测实现,但 SDK 依赖数据才能渲染出应用来。是不是业务侧定义获取数据的资产,spec 里面声明使用那个数据资产合适一些。
整体效果如下:
资产需要注册后使用
registerWidget('custom-sidebar', CustomSidebar);
给资产提供的 API
useGISDK
: 提供完整的 GISDK 上下文useGraph
: 获取 G6 图实例const graph = useGraph();
useGlobalModel
: 获取及更新全局自定义状态const [globalModel, updateGlobalModel] = useGlobalModel()
useWidgets
: 获取及更新组件配置useEventSubscribe
: 事件订阅useEventPublish
: 事件派发