@d3fc/d3fc-pointer

中文文档
3.0.3发布于 2024/06/13MITESM + CJS近 30 天下载 6.2万

Component which emits the current mouse or touch position over a selection

原始使用文档

d3fc-pointer

Very simple component which emits an event to indicate the current mouse or touch position over a selection. Useful for implementing uni-directional data flow in a visualisation and not a lot else.

Main D3FC package

Installing

npm install @d3fc/d3fc-pointer

API Reference

# fc.pointer()

Constructs a new pointer component instance.

# pointer.on(typenames[, callback])

This component dispatches point events. The sole argument to the event handler is an array. If the mouse or touch interaction is over the selection then the array will contain a single object representing the co-ordinate (e.g. { x: 10, y: 10 }). If the mouse or touch interaction is not over the selection then the array will be empty.

See d3-dispatch's on for a full description.

版本与发布记录

@d3fc/d3fc-pointer 共发布 18 个版本,首次发布于 2018/08/02;过去 12 个月发布了 0 个版本。

版本发布日期距今
3.0.3latest2024/06/132 年前
3.0.22020/09/246 年前
3.0.12020/07/146 年前
3.0.02020/04/166 年前
2.2.02020/03/196 年前
2.1.02020/02/146 年前

关于 @d3fc/d3fc-pointer 的常见问题

@d3fc/d3fc-pointer 是什么?

Component which emits the current mouse or touch position over a selection

如何安装 @d3fc/d3fc-pointer?

在项目目录运行 npm install @d3fc/d3fc-pointer,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:d3-dispatch(*)、d3-selection(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@d3fc/d3fc-pointer 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/d3fc__d3fc-pointer 是否存在。

@d3fc/d3fc-pointer 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@d3fc/d3fc-pointer 可以商用吗?

@d3fc/d3fc-pointer 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@d3fc/d3fc-pointer 的下载量有多少?

根据 npm 官方下载统计,@d3fc/d3fc-pointer 在 2026/10/11 – 2026/11/09 这 30 天内被下载 61,726 次,日均约 2,058 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@d3fc/d3fc-pointer 还在维护吗?

最新版本 3.0.3 发布于 2024/06/13(2 年前);至今共发布 18 个版本,其中过去 12 个月发布了 0 个;首次发布于 2018/08/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。