alexa / apl-viewhost-web Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Currently, the viewhost does not take the align property for a VectorGraphic into account.
The APL Core library actually calculates the height, width, X and Y coordinates for a vector graphic and stores the result in the kPropertyMediaBounds property.
https://github.com/alexa/apl-core-library/blob/ba0df9c9f3746800628adb9773e22b206a740f29/aplcore/src/component/vectorgraphiccomponent.cpp#L254
The alignment problem seems to be solved when using the kPropertyMediaBounds property instead of kPropertyInnerBounds.
- const innerBounds = this.component.getCalculatedByKey<APL.Rect>(PropertyKey.kPropertyInnerBounds);
+ const innerBounds = this.component.getCalculatedByKey<APL.Rect>(PropertyKey.kPropertyMediaBounds);
The project seems to be super cool.
But I'm not sure how to use it...
What should we do after installing it from npm?
I've tried to run these codes, but it does not work.
Thanks.
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import 'apl-viewhost-web'
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
$ cp ./node_modules/apl-viewhost-web/index.js public/apl-viewhost-web.js
$ vim public/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script src="apl-viewhost-web.js"></script>
</body>
</html>
$ npx serve public
Looks like the 1.5.1+ version has only source code in NPM, there's no bundled index.js
file that is used as an entry point(main file) in package.json
.
I've done some investigation, looks like this file should be generated during the preinstall
stage. The stage finished successfully(I can see the temp
folder is created and removed in a while, same as node_modules
are installed in the js
folder), but the yarn build:wasm:prod
command did nothing...
Hey, I noticed, that part of apl-viewhost-web is being downloaded. This causes a problem when trying to install offline / from cache because part of the code is being fetched from: https://d1gkjrhppbyzyh.cloudfront.net/apl-viewhost-web/6990ED81-A690-4946-8ACC-63B243C19388/index.js
Is there a chance to bundle this inside the upcoming releases?
Hi Team, I am trying to use APL Client Library to render APL Documents but we are observing slowness. Document takes close to 20 second to render.
We are trying this on a Samsung TV. We suspect this could be a memory Issue.
Is there any ball park estimate of memory/heap required to run this package?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.