Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit eeb0ac4

Browse files
Remove unnecessary defs
* Bump version * Update changelog
1 parent 8f96252 commit eeb0ac4

4 files changed

Lines changed: 18 additions & 19 deletions

File tree

ChangeLog.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.0.2] - 2023-05-05
11+
12+
### Removed
13+
14+
- Unnecessary/unused `<defs>` in the `<svg>`.
15+
1016
## [1.0.1] - 2023-05-05
1117

1218
### Removed
@@ -17,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1723

1824
Initial release
1925

20-
[unreleased]: https://github.com/vibbits/react-2d-molecule/compare/v1.0.1...HEAD
26+
[unreleased]: https://github.com/vibbits/react-2d-molecule/compare/v1.0.2...HEAD
27+
[1.0.2]: https://github.com/vibbits/react-2d-molecule/compare/v1.0.1...v1.0.2
2128
[1.0.1]: https://github.com/vibbits/react-2d-molecule/compare/v1.0.0...v1.0.1
2229
[1.0.0]: https://github.com/vibbits/react-2d-molecule/releases/tag/v1.0.0

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ const mol = {
3131
"width": 3.0,
3232
"height": 3.0,
3333
"atoms": [
34-
{"x": 1.5, "y": -0.0, "element": "H"},
34+
{"x": 1.5, "y": 0.0, "element": "H"},
3535
{"x": -1.5, "y": 0.0, "element": "H"},
3636
{"x": 0.0, "y": 1.5, "element": "H"},
37-
{"x": 0.0, "y": -0.0, "element": "C"},
38-
{"x": -0.0, "y": -1.5, "element": "H"}
37+
{"x": 0.0, "y": 0.0, "element": "C"},
38+
{"x": 0.0, "y": -1.5, "element": "H"}
3939
],
4040
"bonds":
4141
{"source": 3, "sink": 0, "bond": "SINGLE"},
@@ -56,12 +56,12 @@ export const ViewAMolecule = () => <Molecule molecule={mol} />;
5656

5757
### Optional
5858

59-
* `translateX` Translate the whole image on the X axis (default: `0`).
60-
* `translateY` Translate the whole image on the Y axis (default: `0`).
61-
* `scale` Scale the whole image by some fraction (default: `1`).
62-
* `atomClicked` A callback function accepting the index of the clicked atom.
63-
* `atomStyle` A hook specifying CSS styles for the SVG `<circle>`.
64-
* `atomLabelStyle` A hook specifying CSS styles for the SVG `<text>`.
59+
* `translateX: number` Translate the whole image on the X axis (default: `0`).
60+
* `translateY: number` Translate the whole image on the Y axis (default: `0`).
61+
* `scale: number` Scale the whole image by some fraction (default: `1`).
62+
* `atomClicked: (index: number) => void` A callback function accepting the index of the clicked atom.
63+
* `atomStyle: (element: string, selected: boolean): React.CSSProperties` A hook specifying CSS styles for the SVG `<circle>`.
64+
* `atomLabelStyle: (element: string, selected: boolean): React.CSSProperties` A hook specifying CSS styles for the SVG `<text>`.
6565

6666
## Contributing
6767

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vibbioinfocore/react-2d-molecule",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "A React component to display molecule structures in a 2D SVG",
55
"browser": "dist/index.js",
66
"type": "module",

src/index.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,6 @@ export const Molecule: React.FC<MoleculeProps> = (props: MoleculeProps) => {
279279
)}`}
280280
style={{ pointerEvents: "none" }}
281281
>
282-
<defs>
283-
<pattern id="dashes" patternUnits="userSpaceOnUse" width="4" height="4">
284-
<path d="M-1 1 1-1M0 4 4 0M3 5 5 3" />
285-
</pattern>
286-
<mask id="dashes-mask">
287-
<rect height="100%" width="100%" style={{ fill: "url(#dashes)" }} />
288-
</mask>
289-
</defs>
290282
<g
291283
transform={`translate(${translateX}, ${translateY}) scale(${
292284
props.scale || 1

0 commit comments

Comments
 (0)