Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

gpsvg

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gpsvg

convert gpml to svg from gplates

latest
Source
npmnpm
Version
0.0.7
Version published
Maintainers
0
Created
Source

GPML

Convert vectors in GPlates to vectors in SVGs from your terminal program.

Feature in GPlates
at beginning of simulation
Feature in the generated SVG
Link to 1000 Ma svg
Feature in GPlates
after transformations
Feature in the generated SVG
Link to 700 Ma svg
The details stay fairly true in rotation and close up. Unlike GPlates, vectors in the files are translated as straight lines in the SVG.

GPML-to-SVG is currently in alpha. You can get useful results if the shapes you are trying to convert are SHAPES according to GPlates and not lines or dots. Continental Crust and Ocean Crust are safe bets.

System requirement

  • Node 20 or higher

Node is a javascript runtime that is compatible with the major operating systems. You do not need to know Node to use this command line tool.

How to install Node

How to:

Install gpsvg globally:

npm install gpsvg -g

Once it's installed test the installation by running

gpsvg --version

If the cli has been successfully installed you should see something like:

gpsvg --version
0.0.6

To run the conversion, make sure gpsvg is installed. Then pass in commands.

Commands

GPSVG has two commands:

  • convert one or more files at a specific time to a rectangular projection.
  • color-gradient converts a single file but will apply coloring based on feature age and a .cpt file.

Convert options

gpsvg convert -t 900 -d /Users/imauser/testTheCode/ -c "008080" -fn kilroyWasHere "/Users/imauser/folder\ Name/Big\ continents:dinosaur\ friendly.gpml"
convert the command for converting a file or files to an SVG
-t, --time the point in time you want converted, in Ma
required
It will check all features and only render those that exist at this moment in the simulation.
-d --destination the destination folder or directory for the generated SVG
required
Add a space and then put in your full file path. If your path name contains any spaces or special characters, be sure to wrap it in quotes.
-r the rotation file you wish to use
optional
The tool will attempt to find a rotation file near any of the files you pass in if you don't specify one to use.
-c, --color the primary color for the output SVG. This can be a valid CSS color or a hex color.
optional
W3C CSS colors
If you do not provide a color, everything will be rendered in gray.
-mc this is a simple flag. Include it if you want different groups of features (per file) to be colored different shades of the main color. It does not take parameters.
gpsvg convert -c f00 -mc -r "/Users/imauser/...
-fn, --file-name an optional parameter for the name of the output svg.
optional
If no name is provided, the CLI will ask for one during conversion
-lo, --long-offset an optional parameter for offsetting the render horizontally.
optional
"/Users/imauser/folder\ Name/Big\ continents:dinosaur\ friendly.gpml" any files or a directory that you want to convert
required
List your files with a space separating each complete path.

The path or paths you want to convert MUST come last.

Please note: any path with spaces must be in quotes.

Destination, time and a file to convert are required. If you're not passing in a directory of files, the tool will attempt to find a rotation file near any of the files you pass in, and will use the first it finds.

Color-gradient options

gpsvg color-gradient -t 900 -d /Users/imauser/testTheCode/ -fn kilroyWasHere -cr /Users/iamuser/ocean-depth.cpt -f "/Users/imauser/folder\ Name/Big\ continents:dinosaur\ friendly.gpml"
color-gradient the command for converting a file or files to an SVG
-t, --time the point in time you want converted, in Ma
required
It will check all features and only render those that exist at this moment in the simulation.
-d --destination the destination folder or directory for the generated SVG
required
Add a space and then put in your full file path. If your path name contains any spaces or special characters, be sure to wrap it in quotes.
-r the rotation file you wish to use
optional
The tool will attempt to find a rotation file near any of the files you pass in if you don't specify one to use.
-cr the crt file to use for coloring the features.
required
-fn, --file-name an optional parameter for the name of the output svg.
optional
If no name is provided, the CLI will ask for one during conversion
-lo, --long-offset an optional parameter for offsetting the render horizontally.
optional
-f, --file-path the file you wish to convert
required
Unlike `convert` for `color-gradient` you must specify the file you want to convert.

Destination, time and a file to convert are required. The tool will attempt to find a rotation file near any of the files you pass in, and will use the first it finds. It will not try to find .crt files yet.

Please note: any path with spaces must be in quotes.

Example:

FULL PATH: /Users/imauser/folderName/Big\ continents:dinosaur\ friendly.gpml

DESTINATION PATH: /Users/imauser/testTheCode/

COLOR: teal or 008080 or #008080

TIME: 900

ROTATION FILE: /Users/imauser/folderName/shared.rot

gpsvg convert -d /Users/imauser/testTheCode/-c "008080" -t 900 "/Users/imauser/folderName/Big\ continents:dinosaur\ friendly.gpml"

You can convert multiple files into one SVG.

gpsvg convert -c "008080" -t 900 -r /Users/imauser/folderName/shared.rot "/Users/imauser/folderName/Big\ continents:dinosaur\ friendly.gpml" "/Users/imauser/folderName/Big\ continents:terror\  bird.gpml"

or a directory.

gpsvg convert -c "008080" -t 900 -r /Users/imauser/folderName/shared.rot /Users/imauser/folderName

or combinations

gpsvg convert -c "008080" -t 900 -r /Users/imauser/folderName/shared.rot /Users/imauser/folderName /Users/imauser/folderName2/bigDino.gpml

Limitations

As of this version (0.0.6 alpha)

  • only shapes and lines will get converted
  • every file gets converted to a <g> group, which can be selected as a group by Illustrator

To use local version:

  • install Node v20.1.0 or higher: How to install Node
  • clone GPML-to-SVG locally
  • navigate into the GPML-to-SVG directory
  • run npm install
  • run npm run build
  • to run locally replace gpsvg with node dist/index.js

I don't have a PC, so if anyone is willing to test this on a PC, I would appreciate the collaboration.

Keywords

GPlates

FAQs

Package last updated on 09 Sep 2024

Did you know?

Socket

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.

Install

Related posts