Giter Site home page Giter Site logo

apl-viewhost-web's People

Contributors

amazon-auto avatar amzn-admfox avatar bddufour avatar dependabot[bot] avatar lvalencia avatar robsterthelobster avatar zhamingc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apl-viewhost-web's Issues

VectorGraphics are not aligned correctly

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.

https://github.com/alexa/apl-viewhost-web/blob/master/js/apl-html/src/components/avg/VectorGraphic.ts#L103

- const innerBounds = this.component.getCalculatedByKey<APL.Rect>(PropertyKey.kPropertyInnerBounds);
+ const innerBounds = this.component.getCalculatedByKey<APL.Rect>(PropertyKey.kPropertyMediaBounds);

How can we use it?

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.

[NOT WORK] Just Import from CRA

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();

[NOT WORK] Load from index.html

$ 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

How to use the 1.5.1+ version ?

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...

[Info] : Memory footprints for running APL Viewhost Web

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.