Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
trillion-viewer
Advanced tools
Readme
This is Trillion Viewer that allow you to integrate Trillion SDK in your site. For more information please visit https://trillion.jewelry
Using npm:
npm install trillion-viewer
Using yarn:
yarn add trillion-viewer
First of all get your API key from https://dashboard.trillion.jewelry/integration
Then you need to create an empty div element for viewer initialization. For example:
<div id="trillion-viewer"></div>
Then, in your js code (don't forget to set your API key):
import {TrillionViewerApp} from "trillion-viewer"
const elem = document.getElementById('trillion-viewer')
const trillionViewer = new TrillionViewerApp()
trillionViewer.init(elem)
trillionViewer.setServiceActivationKey("YOUR_API_KEY_HERE")
trillionViewer.setJewelryID('demo-ring')
trillionViewer.refresh()
For typescript:
const elem = document.getElementById('trillion-viewer') as HTMLElement
trillionViewer.init()
- Create viewer on the provided HTML elementtrillionViewer.setServiceActivationKey(KEY)
- Set API key for apptrillionViewer.refresh()
- reload viewer after changing parameterstrillionViewer.setJewelryID(sku)
- Set the id(SKU) of the jewelry to loadtrillionViewer.getJewelryID()
- Get the id(SKU) of the uploaded jewelrytrillionViewer.setStartSize(number)
- Set the start size of the jewelrytrillionViewer.getStartSize()
- Get the start size of the jewelrytrillionViewer.setZoomMin(number)
- Set the minumum zoom valuetrillionViewer.getZoomMin()
- Get the minumum zoom valuetrillionViewer.setZoomMax(number)
- Set the maximum zoom valuetrillionViewer.getZoomMax()
- Get the maximum zoom valueAvailable colors and cuts depends on a model
trillionViewer.configuratorController.changeColor({color: '#f5f5f5', materialName: 'metal'})
change color of material. Available materials names can be retrieved from API in future
trillionViewer.configuratorController.changeCut({name: 'oval', frame: 'oval', band?: 'oval'}, RING_CUTS)
change cut of the stone. RING_CUTS
- all available ring cuts, can be retrieved from API in future
and band
- is optional param, used where band is also changed
trillionViewer.configuratorController.engrave('text to engrave')
change engrave for a model, max length 15 symbols
trillionViewer.configuratorController.changeLetter('A', LETTERS)
change engrave for a model, max length 15 symbols LETTERS
- all available letters, can be retrieved from API in future
'VIEWER_LOADED_EVENT' will be fired when viewer is loaded and ready for any user interactions. Here is an example of subscription to that event
document.addEventListener('VIEWER_LOADED_EVENT', () => {
console.log('Viewer is loaded!');
})
use this pattern:
unpkg.com/:package@:version/:file
For example:
import {TrillionViewerApp} from "https://unpkg.com/trillion-viewer@0.2.17/build-lib/trillion-viewer.js"
This library also provides the React component for widget.
import component:
import { TrillionViewer } from "trillion-viewer";
use somewhere in your React application:
function MyComponent() {
return (
<div className="MyComponent">
<TrillionViewer jewelryId={'demo-ring'}/>
</div>
)
}
FAQs
Trillion 3D Viewer
The npm package trillion-viewer receives a total of 257 weekly downloads. As such, trillion-viewer popularity was classified as not popular.
We found that trillion-viewer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.