{"_id":"@polymer-vis/vega-elements","_rev":"9-6759272b35da29165dc745be5967e818","time":{"3.0.2":"2018-10-17T07:21:49.184Z","created":"2018-10-17T07:24:47.295Z","3.0.3":"2018-10-17T07:24:47.605Z","modified":"2022-04-06T15:54:59.337Z","3.0.4":"2018-10-29T10:43:48.896Z"},"name":"@polymer-vis/vega-elements","dist-tags":{"latest":"3.0.4"},"versions":{"3.0.3":{"name":"@polymer-vis/vega-elements","version":"3.0.3","description":"Custom elements to visualize Vega and Vega-Lite views.","module":"index.js","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git://github.com/PolymerVis/vega-element.git"},"scripts":{"prepublishOnly":"npm run build","build":"npm run build:rollup","build:tsc":"npx ttsc","build:rollup":"npm run build:tsc && npx rollup -c && npx rollup -c rollup.config.bundled.js","test":"echo \"Error: no test specified\" && exit 0"},"lint-staged":{"*.{js,json,css}":["prettier --write","git add"]},"keywords":["polymer","web-components","vega","vega-lite","d3","visualization","chart","svg","canvas","ggplot","graphics"],"author":{"name":"eterna2","email":"eterna2@hotmail.com"},"license":"MIT","flat":true,"dependencies":{"@polymer/lit-element":"^0.6.1","vega-embed":"^3.18.2"},"devDependencies":{"@polymer-vis/decorator-transformer":"^3.0.1","rollup":"^0.66.2","rollup-plugin-commonjs":"^9.1.8","rollup-plugin-filesize":"^4.0.1","rollup-plugin-node-resolve":"^3.4.0","rollup-plugin-terser":"^3.0.0","rollup-plugin-typescript2":"^0.17.0","ttypescript":"^1.5.5","typescript":"^3.1.1","vega-typings":"^0.3.47"},"publishConfig":{"access":"public"},"gitHead":"8b4e69b7e0dcd7d1842a5f55ab753e9326d6a4ad","bugs":{"url":"https://github.com/PolymerVis/vega-element/issues"},"homepage":"https://github.com/PolymerVis/vega-element#readme","_id":"@polymer-vis/vega-elements@3.0.3","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"eterna2","email":"eterna2@hotmail.com"},"dist":{"integrity":"sha512-2/BMZCgAUYsGRdrkX8b8czNUfV7YiUEWJoU+/isEiVNt5PDPlRzatbIwX8IK9S/6Fz9R/I//0WPLKF9+Fl8Vtg==","shasum":"743140483e167e4918a4b6d3df2d6f0deecbcbb6","tarball":"https://registry.npmjs.org/@polymer-vis/vega-elements/-/vega-elements-3.0.3.tgz","fileCount":17,"unpackedSize":595288,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxuPACRA9TVsSAnZWagAAI14P/jKkQGnRjcZHXvWHOrFv\nuBLco2X68Rkk/j64K6RUMzf3VbVGzhK6xFJbI7dAUlM4Hiscp18WZjGLWLG0\nD7zjUreClOIyPAWspjXrYiXnI4yWI/qty9USCjtR+NBA2aVA6vJpRSU7kw55\nlbeaMrHOrfnYpFIS4iIqf/nDk+mdBvxWi3ni7OfstpJjCNxeP5MkBUDVOSkZ\ny2pq1hR6qi5a211HoTza6cC5ejxgxtbl0BdvTqmCKzXU03PmSXaNS4oPQY1G\n3RHUZcCv4PBKQCCRnPXQK7sq433K1WFi+iBExDgCOGJHH7zT8s4SdivHiPD4\nzqiKd5dcXW5j6eLTlPnYdk580l4eL/ujcES56YeQFqel3lZHi2SwH36+wrjP\n7MimXx3PPePuURtJg7NRFH6y6Dt/aBX0J8CYKlNxTPOUKsiUUxgAmvFuLj9V\n3g+6tiY7J9pBl1TlZf/lfTE9r6bI0ZJTBVG8TWOiM5Bae5HPvk2nYZ3C2pJW\n/1l1sxqI9hA1mIqLVgvMD3XGfUpfV3gzGZeI+H4LYG2Ss4z7N+sLj5ZKb6K6\nkcyMLoxlc/6sN/to/8DkLgWjRnh7ThOQf3M57mSzYCBfqccHbqFnXSLIt52j\ni+VoD58riaLEoiyVbS0tL9lGjmpLUDum2sNgSsLfwQH+dJs3a5EB+P7l5usP\nTJkr\r\n=bY+2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAT9sTASEQEGeGDVJEEj5HuNgkrrl3eHhofCeQsoe8jAIhANUsTJ3jDIHQSYLWsu8+poJjfS71FURLdfIdLKfGjgaH"}]},"maintainers":[{"name":"ceiling-cat","email":"ceiling-cat@polymer-vis.org"},{"name":"eterna2","email":"eterna2@hotmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vega-elements_3.0.3_1539761087424_0.7127935664543477"},"_hasShrinkwrap":false},"3.0.4":{"name":"@polymer-vis/vega-elements","version":"3.0.4","description":"Custom elements to visualize Vega and Vega-Lite views.","module":"index.js","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git://github.com/PolymerVis/vega-element.git"},"scripts":{"prepublishOnly":"npm run build","build":"npm run build:rollup","build:tsc":"npx ttsc","build:rollup":"npm run build:tsc && npx rollup -c && npx rollup -c rollup.config.bundled.js","test":"echo \"Error: no test specified\" && exit 0"},"lint-staged":{"*.{js,json,css}":["prettier --write","git add"]},"keywords":["polymer","web-components","vega","vega-lite","d3","visualization","chart","svg","canvas","ggplot","graphics"],"author":{"name":"eterna2","email":"eterna2@hotmail.com"},"license":"MIT","flat":true,"dependencies":{"@polymer/lit-element":"^0.6.1","@polymer/polymer":"^3.1.0","vega-embed":"^3.18.2"},"devDependencies":{"@polymer-vis/decorator-transformer":"^3.0.1","rollup":"^0.66.2","rollup-plugin-commonjs":"^9.1.8","rollup-plugin-filesize":"^4.0.1","rollup-plugin-node-resolve":"^3.4.0","rollup-plugin-terser":"^3.0.0","rollup-plugin-typescript2":"^0.17.0","ttypescript":"^1.5.5","typescript":"^3.1.1","vega-typings":"^0.3.47"},"publishConfig":{"access":"public"},"gitHead":"93ce6ef898f2a30c1616f2d197d55e3f0e4e5595","bugs":{"url":"https://github.com/PolymerVis/vega-element/issues"},"homepage":"https://github.com/PolymerVis/vega-element#readme","_id":"@polymer-vis/vega-elements@3.0.4","_npmVersion":"6.4.1","_nodeVersion":"11.0.0","_npmUser":{"name":"eterna2","email":"eterna2@hotmail.com"},"dist":{"integrity":"sha512-yMcL22JXhVUS+lZJ5hU+LmsKEgH9Sn5dGncaYSv1wYWAcfEytrUteJ0TcdDd4kU2aHu7rqI2dnJU/crindOZag==","shasum":"4f90b5f139739b02bdceb9fa9b66f70478133746","tarball":"https://registry.npmjs.org/@polymer-vis/vega-elements/-/vega-elements-3.0.4.tgz","fileCount":17,"unpackedSize":650886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1uRlCRA9TVsSAnZWagAAitEP/2YYRtYENmRsC2Vm/fCJ\nQOo4uUqTuWXgw+4PDjWeN7P6/hs0O46/Cua1BrdoDTwXlytr0smW1Z3eobIk\n1+GKgTl4zK6A7YYbdJZg99v4Gi1ySP8/Fcf/z6YpJj95tsrAMlogXEy5GEDi\nVFMsyALu1M+NSTrKCqdXZPK1dRA6Ai7AyuPDlNDPYP6n5C+Bup4X8WqgkH1a\nV4QmfueY02mSbwiWzQNXHgVbFG61ghsbCvXzJlA2BcduJP0CW+KQvvSuDOii\nzvYYwqxtAKerfT8zJVU0QzJ69mZV+l/wjJ8dFYq7tlCJmAkq5RJHgN7ty1nH\neW4VFU+n/HArub8p8JkhG+y61MrxYNG26jyBi4bc180Oc/w8ICVH2i4A4vDM\n25rQ283So+Qy4GcXq4Vcwi5jSGxgqm/NZY9aIvr293U02L6qpHqNkjxSodty\nUJHIAeI9+eING5zLTv0Sv+UZv/ymT28X9P7FVL4d9tkVVFYq4daEB7WY/W/t\n0VIdGeCq3UyDFB3Znoz/Po3yqE/hFJr9aZt9Np81IOkFDt8osZiFRFB1B8LB\nV54vkPq3RUs/o6Fq0g8UhPWoYBsHVee01Fteo/U7IH0eQq0hgf1wc7Tlx5al\n9H0R1Lr0783kk8YiXySJPGFsR+7RHp8vAIxgn0jW/H3B6BrQMA3LYJdgkeMX\nA5QG\r\n=rO1F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKlzvF1Kbfh32S3xJOm4cD2z1sHm70aRIhZxB8ky0nlQIhAN/yfnEHoZpS0oWOY9WS/NSwMcJE5mD93QZyz4sw45d9"}]},"maintainers":[{"name":"ceiling-cat","email":"ceiling-cat@polymer-vis.org"},{"name":"eterna2","email":"eterna2@hotmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vega-elements_3.0.4_1540809828749_0.4752234429137996"},"_hasShrinkwrap":false}},"maintainers":[{"name":"ceiling-cat","email":"ceiling-cat@polymer-vis.org"},{"name":"eterna2","email":"eterna2@hotmail.com"}],"description":"Custom elements to visualize Vega and Vega-Lite views.","homepage":"https://github.com/PolymerVis/vega-element#readme","keywords":["polymer","web-components","vega","vega-lite","d3","visualization","chart","svg","canvas","ggplot","graphics"],"repository":{"type":"git","url":"git://github.com/PolymerVis/vega-element.git"},"author":{"name":"eterna2","email":"eterna2@hotmail.com"},"bugs":{"url":"https://github.com/PolymerVis/vega-element/issues"},"license":"MIT","readme":"@polymer-vis/vega-elements\n[![GitHub release](https://img.shields.io/github/release/PolymerVis/vega-element.svg)](https://github.com/PolymerVis/vega-element/releases)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/@polymer-vis/vega-elements)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Typescript](https://img.shields.io/badge/typescript-3.1-ff69b4.svg)](https://github.com/Microsoft/TypeScript)\n==========\n\n`@polymer-vis/vega-elements` is a suite of custom elements to render and interact with `[Vega](https://vega.github.io/vega)` and `[Vega-Lite](https://vega.github.io/vega-lite)` specifications and views.\n\nMore API documentation and Demos can be found on [the web components page for vega-elements](https://www.webcomponents.org/element/@polymer-vis/vega-elements).\nMore examples can also be found in the [Github page](https://polymervis.github.io/vega-element/demo/).\n\n**Versions details**  \nv3 is a breaking change, where the components are moved to `npm`, and developed in typescript and inherits from `lit-element` instead of `polymer-element`.\n\n- [**v3**](https://github.com/PolymerVis/vega-element/) Build with Typescript and inherits from Lit-Element (instead of Polymer-Element).\n- [**v2**](https://github.com/PolymerVis/vega-element/tree/polymer2) Supports Polymer 2.0, Vega 3.0, and Vega-Lite 2.0\n- [**v1**](https://github.com/PolymerVis/vega-element/tree/polymer1) Supports Polymer 1.0 and Vega 2.0\n\n## Components\n\nCurrently, only `vega-embed` is available.\n\n**`@polymer-vis/vega-elements/vega-embed.js`**  \n`vega-embed` is a custom element that wraps around the [vega-embed](https://github.com/vega/vega-embed) micro-lib.\n\n## Usage\n\n### Installation\n\n```bash\nnpm i @polymer-vis/vega-elements --save\n```\n\n### Usage in html\n\n```html\n<vega-embed spec=\"/path/to/some/vega/spec.json\"></vega-embed>\n```\n\n### Usage in online code sharing hosts (e.g. jsfiddle, gist, etc)\n\n```html\n<!-- Import Vega 4 & Vega-Lite 2 (as needed) -->\n<script src=\"https://cdn.jsdelivr.net/npm/vega@[VERSION]\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/vega-lite@[VERSION]\"></script>\n\n<!-- Load a bundled version of vega-embed custom element with jsdelivr -->\n<script src=\"https://cdn.jsdelivr.net/npm/@polymer-vis/vega-elements/dist/vega-embed.bundled.min.js\"></script>\n\n<vega-embed spec=\"/path/to/some/vega/spec.json\"></vega-embed>\n\n<script>\n// create a new vega-embed element programmatically\nconst ele = new VegaElements.VegaEmbed();\n// set attribute\nele.setAttribute(\"show-export\", true);\n// set property\nele.showSource = true;\n// set some spec\nele.spec = {...};\n// attach to DOM\ndocument.body.appendChild(ele);\n</script>\n```\n\n### Usage with [`lit-html`](https://github.com/Polymer/lit-html)\n\n```js\n// import lit-html\nimport {render, html} from \"lit-html\";\n\n// import the vega-embed element\nimport \"./node_modules/vega-elements/vega-embed.js\";\n\n// vega-lite specification\nconse scatterplot = {\n  \"$schema\": \"https://vega.github.io/schema/vega-lite/v2.json\",\n  \"description\": \"A scatterplot showing horsepower and miles per gallons for various cars.\",\n  \"data\": {\"url\": \"data/cars.json\"},\n  \"mark\": {\"type\": \"point\", \"tooltip\": {\"content\": \"data\"}},\n  \"encoding\": {\n    \"x\": {\"field\": \"Horsepower\", \"type\": \"quantitative\"},\n    \"y\": {\"field\": \"Miles_per_Gallon\", \"type\": \"quantitative\"},\n    \"tooltip\": [\n      {\"field\": \"Horsepower\", \"type\": \"quantitative\"},\n      {\"field\": \"Miles_per_Gallon\", \"type\": \"quantitative\"}\n    ]\n  }\n};\n\n// create the factory method to create a html template result\nconst embedTmpl = (spec, opts) => html`<vega-embed spec=${spec} opts=${opts}></vega-embed>`;\n\n// render the template result to document body\nrender(embedTmpl(scatterplot, {tooltip: true, renderer: \"canvas\"}), document.body);\n```\n\n## UMD bundles\n\n`vega-elements` provides 2 pre-build UMD distributions (under the named scope `VegaElements`) for `vega-embed` custom element.\n\n- `./dist/vega-embed.min.js`: Minimal bundle with only [`@polymer/lit-element`](https://github.com/Polymer/lit-element) and `@polymer-vis/vega-elements`.\n  Vega, Vega-Lite, and [`vega-embed`](https://github.com/vega/vega-embed) should be imported separately.\n\n- `./dist/vega-embed.bundled.min.js`: Bundle with [`@polymer/lit-element`](https://github.com/Polymer/lit-element),\n  [`vega-embed`](https://github.com/vega/vega-embed), and `@polymer-vis/vega-elements`. Vega or/and Vega-Lite should be\n  imported separately.\n\n## Disclaimer\n\nPolymerVis is a personal project and is NOT in any way affliated with Vega, Vega-Lite, Polymer or Google.\n","readmeFilename":"README.md"}