Skip to content

Instantly share code, notes, and snippets.

@OliverLeighC
Last active April 22, 2021 18:00
Show Gist options
  • Select an option

  • Save OliverLeighC/b4a5b02889b15eef75dedae8e91f5be9 to your computer and use it in GitHub Desktop.

Select an option

Save OliverLeighC/b4a5b02889b15eef75dedae8e91f5be9 to your computer and use it in GitHub Desktop.
TransformationBug
Display the source blob
Display the rendered blob
Raw
<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" style="font-family:Helvetica;font-size:12px;" width="600" height="600" viewBox="0 0 600 600">
<g data-z-index="0.1" opacity="1" transform="translate(590,509) rotate(90) scale(-1,1) scale(1 1)">
<rect x="344.5" y="291.5" width="50" height="204" fill="#A9DACC" stroke="#ffffff" strokeWidth="1" opacity="1" />
<rect x="120.5" y="51.5" width="50" height="444" fill="#A9DACC" stroke="#ffffff" strokeWidth="1" opacity="1" />
</g>
</svg>
import React from 'react';
import { Document, Page, Text, View, StyleSheet, Svg, G, Rect } from '@react-pdf/renderer';
const TestChart = (
<Svg
style={{ fontFamily: "Helvetica", fontSize: "12px" }}
width="600"
height="600"
viewBox="0 0 600 600"
>
<G
data-z-index="0.1"
opacity="1"
transform="translate(590,509) rotate(90) scale(-1,1) scale(1 1)"
>
<Rect
x="344.5"
y="291.5"
width="50"
height="204"
fill="#A9DACC"
stroke="#ffffff"
strokeWidth="1"
opacity="1"
/>
<Rect
x="120.5"
y="51.5"
width="50"
height="444"
fill="#A9DACC"
stroke="#ffffff"
strokeWidth="1"
opacity="1"
/>
</G>
</Svg>
)
const styles = StyleSheet.create({
row: {
flexDirection: 'row',
justifyContent: 'space-between'
},
column: {
flexDirection: 'column',
width: `${DEFAULT_COL_WIDTH}%`
},
body: {
paddingTop: 35,
paddingBottom: 65,
paddingHorizontal: 35,
fontFamily: 'Open Sans'
},
})
function Report() {
return (
<Document title='Test_Report'>
<Page size="A4" style={styles.body}>
<View style={styles.row}>
<View style={styles.column}>
{TestChart}
</View>
</View>
</Page>
</Document>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment