Konva Line Not Appearing

时间:2019-02-21 05:00:31

标签: reactjs react-konva

Hi while I was writing some code for a web application using the React I decided to use the library Konva to make shapes.

class Prism extends Component{

render() {
  return(
    <p style = {col}>
        <Stage width={window.innerWidth/2} height={window.innerHeight/2}>
        <Layer>
          <Rect
            x={window.innerWidth/12}
            y={window.innerHeight/12}
            width={this.props.BigRedRectangleWidth- 2*this.props.SliderValueforCorner}
            height={this.props.BigRedRectangleHeight- 2*this.props.SliderValueforCorner}
            fill="Red"
            shadowBlur={0}

          />
        </Layer>
    <Layer>
      <Rect
        x={window.innerWidth/12+(0.70710*this.props.SliderValueforCorner)}
        y={window.innerHeight/12+(0.70710*this.props.SliderValueforCorner)}
        width={this.props.BigRedRectangleWidth- 2*this.props.SliderValueforCorner}
        height={this.props.BigRedRectangleHeight- 2*this.props.SliderValueforCorner}
        fill="Black"
        shadowBlur={0}
      />
    </Layer>
    <Layer>
      <Line
        points={[73, 70, 340, 23, 450, 60, 500, 20]}
        fill="Black"
      />
    </Layer>
    </Stage>
    </p>
        );
      }
}
export default Prism;
const Stages = {
    alignSelf:'center',
}
const col = {
    textAlign: 'center',
    width: '50%',
    marginTop: '20px',
    borderRadius: '4',
    borderWidth: '0.5',
    borderColor: '#d6d7da',
    marginBottom: '100px'
  }
However, the line I defined does not show up. The rectangles show up fine so I was just wondering where I messed up.

Thank You!

1 个答案:

答案 0 :(得分:0)

您的行未关闭。因此它不能有spark-submit --master yarn --class com.i2c.chprofiling.App App.jar \ --num-executors 4 --executor-cores 3 --conf "spark.locality.wait.node=0" 。我猜您想改用fill

stroke