Skip to content

Instantly share code, notes, and snippets.

@mikesurowiec
Created October 7, 2017 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikesurowiec/f41a95479f6dcfef86fb2313130b0af9 to your computer and use it in GitHub Desktop.
Save mikesurowiec/f41a95479f6dcfef86fb2313130b0af9 to your computer and use it in GitHub Desktop.
import React from 'react';
import DCMetroMapHTML from './DCMetroMapHTML.js';
import Dimensions from 'react-dimensions';
const svgViewportWidth = 3266;
const svgViewportHeight = 3012;
class DCMetroMap extends React.Component {
render() {
const { containerHeight, containerWidth } = this.props;
return (
<div id="container">
<svg
width={containerWidth}
height={containerHeight}
viewBox={[0, 0, svgViewportWidth, svgViewportHeight].join(' ')}
version="1.1"
>
<g id="contentWrap"
dangerouslySetInnerHTML={{ __html: DCMetroMapHTML }}
/>
</svg>
);
}
}
export default Dimensions()(DCMetroMap);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment