用途:开发、构建与审查 nebula.js(stardust)可视化图表,适用于创建 supernova 图表、实现 hooks(usePromise、useLayout 等)、配置属性面板与数据目标,以及进行无引擎的 fixture 测试。
主要能力:提供多文件起始模板(assets/advanced-chart-template 下的 index.js、data.js、object-properties.js、ext.js、components/root.jsx、AdvancedChart.jsx、chart.css 及 sample-fixture.fix.js),建议先复制模板再填充 TODO。脚手架命令:npx @nebula.js/cli create <name> --picasso none(纯 canvas/DOM)、--picasso minimal(picasso.js)、无参数(完整 picasso 柱状图)。开发命令:npm run start(热重载开发服务器)、npm run build(打包到 /dist)、npm run sense(打包为 Qlik Sense 扩展)。
使用方式:supernova 入口导出 qae(properties、data)、ext 与 component()。所有 hooks 必须在 component() 顶层调用,不可条件调用或改变调用顺序。常用 hooks 包括 useElement、useLayout/useStaleLayout、usePromise、useTheme、useRect、useSelections、useInteractionState,以及 useModel、useApp、useTranslator、useDeviceType、useState、useMemo、useRef、useAction 等。异步数据应使用 usePromise 而非裸 useEffect,以保证快照/打印与集成测试稳定。React 需在 useEffect 中挂载并在清理时 root.unmount(),且不要在 React 组件内调用 nebula hooks。属性面板在 ext.js 中定义,使用 galaxy 访问环境,支持 data、sorting、settings 等内置区块及 color-picker、switch、slider 等组件。数据配置在 data.js 的 targets 与 object-properties.js 的 qHyperCubeDef 中定义。
适用场景:Qlik Sense 自定义可视化扩展开发、图表渲染与选择交互、主题适配、快照导出与 fixture 测试。
限制:hooks 仅能在 component() 内使用;useRect 需消费者 polyfill ResizeObserver;打印安全需避免 setTimeout/requestAnimationFrame 改变可见输出;ext 中不可用 nebula hooks。具体收费、平台与效果资料暂未提供。