react-path-marker
Advanced tools
Comparing version 1.0.3 to 1.0.4
import React, { useState, useEffect } from 'react'; | ||
import { PathTooltip } from 'react-path-tooltip'; | ||
@@ -76,2 +77,13 @@ var PathMarker = function PathMarker(props) { | ||
}, [pathRef, svgRef, markerRef, textRef]); | ||
var tooltipTextColor = props.tooltipTextColor ? props.tooltipTextColor : props.textColor ? props.textColor : "white"; | ||
var tooltipBgColor = props.tooltipBgColor ? props.tooltipBgColor : props.bgColor ? props.bgColor : "black"; | ||
var tooltip = props.bigText ? React.createElement(PathTooltip, { | ||
svgRef: svgRef, | ||
pathRef: markerRef, | ||
bgColor: tooltipBgColor, | ||
tip: props.bigText, | ||
fontFamily: fontFamily, | ||
fontSize: fontSize, | ||
textColor: tooltipTextColor | ||
}) : React.createElement("g", null); | ||
return React.createElement("g", null, React.createElement("path", { | ||
@@ -97,3 +109,3 @@ ref: markerRef, | ||
fill: textColor | ||
}, props.smallText)); | ||
}, props.smallText), tooltip); | ||
}; | ||
@@ -100,0 +112,0 @@ |
@@ -6,5 +6,8 @@ import React from 'react'; | ||
fontSize?: number; | ||
bigText?: string; | ||
tooltipBgColor?: string; | ||
fontFamily?: string; | ||
bgColor?: string; | ||
smallText?: string; | ||
tooltipTextColor?: string; | ||
textColor?: string; | ||
@@ -11,0 +14,0 @@ } |
{ | ||
"name": "react-path-marker", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"license": "MIT", | ||
@@ -17,3 +17,4 @@ "displayName": "React Path Marker", | ||
"react": ">=16.0.0", | ||
"react-dom": ">=16.0.0" | ||
"react-dom": ">=16.0.0", | ||
"react-path-tooltip": "^1.0.9" | ||
}, | ||
@@ -27,3 +28,4 @@ "devDependencies": { | ||
"@types/react": "^16.9.34", | ||
"@types/react-dom": "^16.9.6" | ||
"@types/react-dom": "^16.9.6", | ||
"react-path-tooltip": "^1.0.9" | ||
}, | ||
@@ -30,0 +32,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19159
8
116
3
8