Comments (10)
It's mainly called from ibom.js
through redrawCanvas()
from interactivehtmlbom.
Ohh okay, where is redrawCanvas() called in the self contained html file?
from interactivehtmlbom.
Use the search function on github or in your IDE and you will easily see where it is called.
I'll give you brief overview of how it works but I can't teach you how to read code.
There is ibom.html template in the web directory, it has basic frame of the page and placeholders for javascript, css and pcb data. When python part generates the bom it compiles the pcb data into format that is described in DATAFORMAT.md
and injects that data along with all the javascript and css into the template as output. The resulting html file has a window.onload
handler which gets executed first thing as browser loads the page, that handler renders initial image and generates the bom table. Each time you resize the window or manipulate the bom in a way that affects the drawing things get rerendered again.
from interactivehtmlbom.
Thank you! I seemed to miss the window.onload handler when initially reading the code and was getting lost. That cleared it up.
from interactivehtmlbom.
I am using https://github.com/juulsA/exportJson in order to extracty json data from Allegro pcb files. And then I edited the json to add a field in every component, called "numdefects". When I try to generate the the html, I am led to an error that is thrown here in "genericjson.py". I cannot follow it further though and I was wondering where the validation occurs and if I can add this extra field in the expected json structure.
from interactivehtmlbom.
Validation happens here
https://github.com/openscopeproject/InteractiveHtmlBom/blob/master/InteractiveHtmlBom/ecad/genericjson.py#L41
Most likely you edited the json in a way that breaks schema compliance, make sure you read the schema https://github.com/openscopeproject/InteractiveHtmlBom/blob/master/InteractiveHtmlBom/ecad/schema/genericjsonpcbdata_v1.schema
The error message should tell you what the issue is.
from interactivehtmlbom.
Thank you, that cleared it up.
How can I reference the components in the javascript as I am putting my defect data in the "extra_fields" section of components?
Also, in render.js, what type of object is pcbdata.footprints ? I thought it was a dictionary based off of the dataformat but then in "drawfootprints" and specifically line 388 I see that you iterated through it using pcbdata.footprints.length.
from interactivehtmlbom.
It's an array, you can check such things in browser dev tools console.
from interactivehtmlbom.
Okay, thanks! How can I reference components in the javascript? It is not a part of pcbdata upon checking devtools
from interactivehtmlbom.
I don't understand the question, you reference items in an array as you normally would, by index or you just iterate over it with for (.. of ..)
construct. What isn't part of pcbdata?
from interactivehtmlbom.
Related Issues (20)
- Include tracks/zones not working. HOT 3
- Ibom is summarizing components with the same value, but different part number HOT 5
- Filter on multiple schematic sheets HOT 1
- Configurable keyboard bindings HOT 1
- Support for Altium Designer is recommended 建议对Altium Designer支持 HOT 1
- IBOM isn't rendering correctly on iOS devices HOT 2
- Feature Request: Additional fields in the board image HOT 5
- Doc for blacklist/whitelist? HOT 4
- kicad: dnp has no effect on Fab layers HOT 3
- Board Heatmap Feature HOT 2
- "Highlight first pin" option is cluttered in macOS HOT 2
- Highlight first pin in settings has no effect HOT 2
- big, comfortable checkboxes in table HOT 2
- Making Part number permanent field in BOM export HOT 4
- There is no reaction to some of the options HOT 2
- Disable the display of certain fields in ibom HOT 4
- Not working in kicad-nightly-8.99 HOT 2
- when i use generate_interactive_bom in cadence skill, it retun nil HOT 6
- Missing some Pin 1 silkscreen triangles HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from interactivehtmlbom.