I'm working on a project where I'm only using polymer mini features (polymer-mini.html) and a custom template engine. Now I want to use a polymer component thats relying on polymer standard features (polymer.html).
When i include the component using the polymer standard features - there are conflicts between the custom template engine and the polymer standard features.
Is there a way that I can include polymer standard for all components, but disable all polymer standard features on specific compontents? In my case, on those using the custom template engine..
Polymer feature layering:
https://www.polymer-project.org/1.0/docs/devguide/experimental.html
Related
I am working on a React-Python/Flask app which takes input bpmn diagram image from user & through python scripts convert it into bpmn file which then can be downloaded through flask api on user's device. I am working on react UI. Now i have to edit the diagrams & apply some visualization to them. So how can i integrate yFiles for html BPMN editor in my app. I have already downloaded its evaluation package from yworks.com & integrated the pack in React following the demos. But now i am stuck because there are not much tutorials available specifically for yFiles with react. When i searched for it, i found lots of tutorials of bpmn.js with react. Please help me with how can i go about it. I am new to yFiles I have looked into yFiles evaluation pack tutorials and i still dont know how to go about it in react. Also i have to use yFiles only due to client's requirement. Thank you for any help.
yFiles for HTML is not a React component - in fact it's a plain JavaScript component, that is not based on any third party framework or even software.
This doesn't mean that you cannot integrate it into React or Angular or Vue.js or any other well-behaved JavaScript client framework. In fact yFiles has been built to support the integration into all of these frameworks and if it doesn't work with a specific framework, this usually indicates a short-coming or more likely a bug in the third party framework, rather than in yFiles! After all yFiles is just this: plain JavaScript that manages a part of your HTML5 DOM (one div element and all it children, to be precise), a few lines of CSS and the rest is just JavaScript. If your UI library can provide these basic requirements (and React does, of course), yFiles can be made to run with that framework.
As you said, there are these various integration samples available that show how to integrate third party frameworks and yFiles (both with yFiles being a "client" as well as yFiles hosting DOM snippets created and maintained by these third party frameworks: https://github.com/yWorks/yfiles-for-html-demos/tree/master/demos/toolkit
For React, there is actually an additional repo on GitHub (which is not part of the evaluation package): https://github.com/yWorks/yfiles-react-integration-basic
React is very opinionated about the way an application or component should work. yFiles does not follow the React approach (and I honestly believe it would be a bad idea if it did), but the component you build can. The idea is to create a custom React component that internally uses yFiles for HTML for the visualization, the editing, and the handling of the BPMN editor. Just like you would encapsulate a native HTML5 textarea and two buttons into a React component, you encapsulate the "div" that is used by yFiles to manage the BPMN visualization and editor.
The BPMN demo does not use React. In fact it uses plain old HTML and does not use any real framework for the UI. This means you need to (and can) take that code and wrap it into a custom React component.
With the node module version of yFiles for HTML and the es6 style sample code, this should not be too difficult. After all it's just JavaScript without any further dependencies.
There are no additional tutorials for yFiles in the context of React. However that should not be much of a problem as any tutorial that shows how to wrap a generic JavaScript component or how to create a new one from scratch should be applicable.
If you run into a specific issue, post your question here (if it's about React) or contact the support team at yWorks if you are sure this is a problem specific to yFiles and not a generic JavaScript problem. Of course StackOverflow might work, too, in the yFiles case, however there aren't that many yFiles developers that hang around at StackOverflow, I think. Most of the time it's me or someone from the yWorks team, anyway.
I would like to build a complicated web component that:
I Can use in my legacy web site (or any other site)
It can be used weather my web site is built with Angular/Angular2/React/Jquery etc...
I can use any technology to build it Angular/Angular2/React etc...
Avoid dependencies & versioning collisions (i.e my component is built with Angular 1.5.6 and the implementing website has Angular 1.4.7)
Would using NPM module could solve this issue (versioning, depenencies etc..) ?
Edit: (example)
For example i would require my component via npm
which has the dependency (requires) the framework i chose (i.e angular 1.5.6)
in this scenario wouldn't my component code use my dependency from NPM (regardless what the site uses)?
You may use a component built with angular on a legacy site but you must load angular before. You should be aware of name collision you might have with other directories.
If the site is already built with angular 1.x you may just blend your component in, considering that your component is compatible to the angular version the site is using.If it is not, I think react can be possible because it may blend in.
In case the site is built with angular 1.4.7, as you have said, you might need to downgrade your component to be used by 1.4.7. This means that if you're using angular.module(...).component you will need to switch it to directive. Alternatively you may switch the site to work with 1.5 if it is possible. If not, you may go back to react.
If you want to use angular 2.0, you may do so side by side with angular 1.x, however, the legacy application needs to be bootstraped with angular upgrade module, using upgradeAdapter. This means you need to interfere with the application, which you don't want to, if I understand you correctly.
Please help me understand the following quotes from the Angular Material github and home page:
This project is in early pre-release. Angular Material is both a reference implementation of Material Design and a complementary effort to the Polymer project's Paper Elements collection.
The Angular Material Design project is a reference implementation effort similar to that provided in the Polymer project's Paper elements collection. This project provides a set of AngularJS UI elements that implement the material design system.
I understand that Polymer is a framework for web components, and that one piece of the project is the collection of paper elements. I do not understand how the two are related, or why Google is developing two strikingly similar, yet different projects.
Is angular material simply a port of Paper Elements to angular?
Are web developers to use Angular Material right alongside Paper Elements in their web apps?
Are the two eventually going to effectively become equivalent? (Angular Material being used by AngularJS developers & Paper Elements used by others?)
I think you should consider the fact that web components, polymer, material design, paper elements and angular are 5 distinct 'things'.
Web components is a group of 4 standards.
Polymer is a sugar syntax api on top of web components + some nice additional features.
Material Design is the latest style and interaction guide Google has announced and they are
replicating more consistently across all their interfaces..web/mobile/etc.
Paper Elements are just an implementation of material design using Polymer. At the ChromeDev Summit Polymer team commented they plan to move paper elements into its own domain to avoid the confusion. Same things about the polyfills, these have been moved to webcomponents.org.
Angular is a library with a much wider scope than polymer.
Angular Material is just another implementation of material design using Angular.
My point being...material design will be reimplemented in as many flavors Google has to generate interfaces.
Google has a history of competing projects. But Angular's team has announced they will be using web components as well in their 2.0 version which is on the works right now. Will they use polymer to create directives? who knows? maybe..
From the recent ng-conf 2015 announcements it's clear that Angular 2.0 will have a new syntax and implementation to write Web Components spec based Custom Components (Directives).
Also, Angular-Material team has announced that post 1.0, they'll be porting it to Angular 2.0.
Hence, integration of Angular-Material and Polymer isn't in sight...Though, the good thing is that coz they're both based on Web Component Spec, they play well together, meaning that either can be used in an Angular App...
I am a backend engineer but need to come up with a front end. Can I use Jetstrap/Codiqa and create a pretty UI using drag and drop. Can I then export the html and add the angular keywords? Is this the best practise for a non front-end person creates a UI?
I've used codiqa to design an phone app using phonegap. Codiqa generates code based on jQuery. it's possible to add angular after you export the code. Not very common to mix angular and jquery, from what I've seen though. Another online prototyping tool I recently found that generates AngularJS code (as well as Phonegap based Steroid.js) is AppGyver's composer. Comes with some built in color themes (similar to jQuery) and you're able to create a mobile app quickly based on Steriods.js/Phonegap.
I am quite new in Angular world. I am working on an application which involves Angular JS. I've been confronted with the requirement to implement custom scrollbar. My application does have jQuery too, but so far most part of my project uses Angular. So should I be using some jQuery widget or implement it via Angular.
If Angular, can you provide me pointers on how should I proceed?
You should probably implement it in the Angular way, i.e., building / using a custom Angular's directive:
http://docs.angularjs.org/guide/directive
Learning resources for Angular:
https://github.com/jmcunningham/AngularJS-Learning
You can always use jQuery plugins / widgets in an Angular app, but in that case the best way is to encapsulate each plugin within a directive. Angular-UI is a project which does that for several components, including Twitter Bootstrap:
http://angular-ui.github.io/
I'm aware of angular-perfect-scrollbar, a simple Angular's directive for perfect-scrollbar, but haven't tested it yet:
https://github.com/itsdrewmiller/angular-perfect-scrollbar
http://www.yuiazu.net/perfect-scrollbar/
Depending on what your requirements are, you can style your scrollbars strictly in CSS and not need any JavaScript:
http://css-tricks.com/custom-scrollbars-in-webkit/