Trên GitHub, vega/react-vega đã đạt 426 sao, ngôn ngữ TypeScript. Convert Vega spec into React class conveniently
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
If you only need to use Vega (not Vega-Lite), you can install vega.
npm i react-vega vega-embed vega
Migrating to v8
In v8, the data prop was removed. Additionally, you can no longer update data by changing spec.data without the view being re-embedded. Instead use the View API to update data. See the Dynamic data recipe for an example.
The height and width props were removed. Additionally, you can no longer resize the view by changing spec.width or spec.height without the view being re-embedded. Instead use the View API to resize the view. See the Programmatically changing width & height recipe for an example.
The signalListeners prop was removed. Instead use the View API to subscribe to signal events. See the Subscribe to signal events recipe for an example.
Vega embed options are passed directly via the options prop, they are no longer flattened props on the VegaEmbed component.
Quick start
import { VegaEmbed } from "react-vega";
function Component() {
return <VegaEmbed spec={spec} options={options} />;
}
or
import { useVegaEmbed } from "react-vega";
function Component() {
const ref = React.useRef<HTMLDivElement>(null);
const result = useVegaEmbed({ ref, spec, options });
return <div ref={ref} />;
}
API
<VegaEmbed />
Prop
Type
Default
Notes
spec(required)
VisualizationSpec | string
—
Inline spec or URL. Accepts both Vega & Vega-Lite.
options
EmbedOptions
{}
Passed directly to embed().
onEmbed
(result: Result) => void
—
Called once embed() resolves. See Result for details.
onError
(err: unknown) => void
—
Called if embed() rejects.
...divProps
React.HTMLAttributes<HTMLDivElement>
—
Forwarded to the <div> element used for embedding.
ref
React.Ref<HTMLDivElement>
—
Forwarded to the <div> element used for embedding.
Returns the current Result (or null while loading).
Important
Any changes to spec or options will cause the view to be torn down and re-embedded. If you need to update the view without re-embedding, use the View API. Refer to the Recipes section for common use cases.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/vega/react-vega là nguồn chính thức.
vega/react-vega có bao nhiêu sao?
vega/react-vega có 426 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/vega/react-vega. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
vega/react-vega có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho vega/react-vega. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
vega/react-vega còn đang phát triển không?
Commit gần nhất trên vega/react-vega là 9 ngày trước (theo timestamp GitHub). Repo có 76 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
vega/react-vega viết bằng ngôn ngữ gì?
vega/react-vega chủ yếu viết bằng TypeScript. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về react-vega?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về react-vega.