cm-chessboard 5.1.0 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -283,7 +283,7 @@ Example: The markerCircle is defined in the SVG like this.
|
|
|
283
283
|
It's a circle with the radius 18 and its center at 20/20.
|
|
284
284
|
|
|
285
285
|
Important is the id "markerCircle". You can set the marker
|
|
286
|
-
with `board.addMarker(
|
|
286
|
+
with `board.addMarker({class: "markerSquare", slice: "markerSquare"}, "e4")`
|
|
287
287
|
"emphasize" is the css class, which defines the color and opacity of the marker. "slice" is the id of the marker in the
|
|
288
288
|
SVG. This is
|
|
289
289
|
also demonstrated in the [mark squares example](https://shaack.com/projekte/cm-chessboard/examples/input-callbacks.html)
|
|
@@ -310,18 +310,18 @@ marker.markerCircleRed {
|
|
|
310
310
|
So you can simply add a marker with the id `myMarkerIdInSvg` to the SVG, and add the class `myMarkerCssClass` to the
|
|
311
311
|
css. Then you can show it on the field "e4" with
|
|
312
312
|
|
|
313
|
-
`addMarker(
|
|
313
|
+
`addMarker({class: "myMarkerCssClass", slice: "myMarkerIdInSvg"}, "e4")`
|
|
314
314
|
|
|
315
315
|
To allow easy removing of the marker, you have to define the marker type in your code.
|
|
316
316
|
|
|
317
317
|
```js
|
|
318
318
|
const myMarkerType = {class: "myMarkerCssClass", slice: "myMarkerIdInSvg"}
|
|
319
319
|
// add
|
|
320
|
-
chessboard.addMarker("e4"
|
|
320
|
+
chessboard.addMarker(myMarkerType, "e4")
|
|
321
321
|
// remove
|
|
322
|
-
chessboard.removeMarkers("e4"
|
|
322
|
+
chessboard.removeMarkers(myMarkerType, "e4")
|
|
323
323
|
// remove all "myMarkerType"
|
|
324
|
-
chessboard.removeMarkers(
|
|
324
|
+
chessboard.removeMarkers(myMarkerType, undefined)
|
|
325
325
|
```
|
|
326
326
|
|
|
327
327
|
## Extensions
|