Package Exports
- cube-preview
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cube-preview) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Cube Preview
Node.js
yarn add cube-preview
# or
npm install cube-previewconst { CubePreview } = require('cube-preview');
const threebythreePreview = new CubePreview(); // Defaults to 3x3
console.log(
threebythreePreview
.setColorScheme({ R: 'pink' })
.svgString('RBLUULUBFRBDBRRBRFFDDFFRLFDBULDDFDLRURLLLDBLUFUBDBUUFR')
); // Returns the svg string matching the given state, with pink instead of redAPI
.svg(state); // Return the svg string matching the given state
.setType(type); // Set the type, defaults to 333 (Valid types: 222, 333, ..., NNN)
.setCubieSize(num); // Set the cubie size, defaults to 20
.setSpacing(num); // Set the spacing between each side, defaults to 2
.setColorScheme(object); // Set the color scheme
defaultColorScheme = {
U: 'white',
R: 'red',
F: 'green',
D: 'yellow',
L: 'orange',
B: 'blue',
};Status
Works for all NxNxNs.
Only output svg Strings.
Contribute
Pull requests are welcome!