
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
golf-2d-graphs-prototype
Advanced tools
Golf statistics and graph visualisations using the Canvas API.
Any new canvas visualisation can be added as a new static method on the Golf2DGraphs
class, prefixed with "render"
and passed as an argument to Golf2DGraphs.init
. This method can render anything the the canvas context (Golf2DGraphs.ctx
).
For elements and coordinates needing to be resized, use the util functions getShapeSize()
to set them dynamically based on the window size.
Overall view perspective is controlled using the constant VIEW_PERPECTIVE
, which will be applied to all elements drawn with the transformByPerspective()
util.
For elements drawn without perspective (ie arcs and markers), their coordinates must be passed to the getTransformedCoordinates()
util, unless their y coordinate is the canvas centre (in the case of flags and balls) so transformation doesn't apply.
Trees are rendered via the Tree class, which utilises 2 images converted to base64 and stored within the treeImages
object (in src/images.ts). They are indexed using the name taken from the golf 3D assets repo, which is passed to the Tree class when instantiating, ie med5
.
Upon instantiating an optional colour string parameter can be passed for leaf colour.
Images are saved as a black and white desaturated image with the _leaves
suffix, and a coloured trunk image _trunk
.
These are saved as PNG-8 with 4 or 8 colours, and cropped to >=250 pixels width with the trunk centred, before base64 conversion.
FAQs
Visualisation module for golf statistics
We found that golf-2d-graphs-prototype demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.