score:0

you can render shapes in react native using react-native art

import { art } from 'react-native';
const { shape, group surface } = art;

you can create shapes using 'd3-shape' npm package https://github.com/d3/d3-shape/blob/master/readme.md .

d3-shape will give you the 'path'. for example:

var arc = d3.arc()
.innerradius(0)
.outerradius(100)
.startangle(0)
.endangle(math.pi / 2);

when you execute this function it will return a long string of letters and numbers which can be used to draw your shape.

simply, put it into react-native art's shape like so:

render() {
    return (
        <surface>
           <group>
              <shape d={arc()} /.
           </group>
        </surface>
     )
   }

also this is a good article: https://hswolff.com/blog/react-native-art-and-d3/


Related Query

More Query from same tag