airbnb / visx

🐯 visx | visualization components
https://airbnb.io/visx
MIT License
19.5k stars 716 forks source link

[future] cross-platform support #41

Closed hshoff closed 2 years ago

hshoff commented 7 years ago

vx should work on web, native, vr, everywhere. The current implementation depends on react-dom which means it's only available on web.

@lelandrichardson's talk React as a Platform https://www.youtube.com/watch?v=hNwQPJy-XZY https://github.com/lelandrichardson/react-primitives-art

Rohithzr commented 7 years ago

I agree, I am in the process of building react app and react-native app, so I would be highly inclined towards using a solution that can be implemented across the two platforms.

hshoff commented 7 years ago

https://github.com/chengyin/react-primitives-svg

hshoff commented 7 years ago

https://github.com/godaddy/svgs

colinhiggins commented 7 years ago

Hi @hshoff, this looks like an awesome package, and if @williaster is involved, I'm sure its the next great thing. I'd love to use this on a project I'm kicking off at work, but we have a strong need to support mobile. I'm wondering where this issue falls on your roadmap. I also wonder if this is the only issue that prevents use of vx on mobile (e.g. is there further support needed for touch instead of a cursor?).

hshoff commented 7 years ago

Hi @colinhiggins, thanks for checking out vx!

Are you looking to use vx on mobile web or in an iOS/Android app? If mobile web, you should be fine to start using vx. iOS/Android app support should be coming in the future.

colinhiggins commented 7 years ago

An iOS/Android app. Probably iOS first. We could try to render a webview in the app I suppose, but ideally we wouldn't have to resort to that.

hshoff commented 7 years ago

@colinhiggins gotcha, vx doesn't support those platforms yet.

jacek213 commented 6 years ago

in react native it should probably be done using ART built-in lib: https://github.com/facebook/react-native/tree/master/Libraries/ART. No one bothered to prepare official docs, here's all I found: https://github.com/react-native-china/react-native-ART-doc/blob/master/doc.md

techniq commented 6 years ago

Chatted in Slack but worth mentioning here, it would be nice to support canvas along with svg

kono-paku commented 5 years ago

@hshoff It has been one and half year.. Is there any plan to supoort this?

hshoff commented 5 years ago

Not a priority for me right now. Happy to read over proposals if anyone has one.

macintoshhelper commented 4 years ago

Hi, I've opened a draft PR for a fork that I've been working on, with react-primitives support. There's an injection API and extension resolving, so you can import svg components with:

import { Svg, G, Defs } from '@vx/primitives',

and they resolve to: <svg>, <g>, etc on web,

or to require('react-native-svg').Defs or require('react-sketchapp').Defs, etc

d3 meets Sketch.app 🙂

image

bradydowling commented 3 years ago

For anyone that does need dataviz on React Native, what alternatives are you using in the meantime?

macintoshhelper commented 3 years ago

For anyone that does need dataviz on React Native, what alternatives are you using in the meantime?

Hi, I've published a couple of npm modules from my vx-primitives fork: @vx-primitives/primitives, @vx-primitives/shape, etc which should work on React Native, react-sketchapp, etc. It's a little outdated since it's time-consuming to merge changes downstream. I'd be happy to merge any contributions to the fork and publish the rest of the visx packages under vx-primitives once/if they're implemented.

GokulSNarayan commented 2 years ago

It would be great if this feature gets rolled out.