Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection page review (June 2021) #27

Closed
8 of 13 tasks
dhmacs opened this issue Jun 23, 2021 · 7 comments
Closed
8 of 13 tasks

Collection page review (June 2021) #27

dhmacs opened this issue Jun 23, 2021 · 7 comments
Assignees

Comments

@dhmacs dhmacs self-assigned this Jun 23, 2021
@kwiens
Copy link
Member

kwiens commented Jun 23, 2021

Wikis API has documents: https://www.ifixit.com/api/2.0/doc/Wikis#content

Schematics are not in the API but will be.

@evannoronha
Copy link

Schematics are not in the API but will be.

I'm not sure what you mean by this, but Schematics are currently served by the API. They are just not documented. The endpoint is available to the public: https://www.ifixit.com/api/2.0/diagrams/418

@kwiens
Copy link
Member

kwiens commented Jun 29, 2021

Sweet! How do you get a list of diagrams for a device?

@evannoronha
Copy link

Sweet! How do you get a list of diagrams for a device?

CR this pull to find out: https://github.com/iFixit/ifixit/pull/38255

@dhmacs
Copy link
Contributor Author

dhmacs commented Jul 23, 2021

Sweet! How do you get a list of diagrams for a device?

CR this pull to find out: https://github.com/iFixit/ifixit/pull/38255

Hi @evannoronha, I don't have access to this repo. Can you give me instructions on how to use this endpoint?

@evannoronha
Copy link

evannoronha commented Jul 28, 2021

Sure thing! As of right now, I don't think you'll get much use out of it because the set of devices for which we have schematics and parts to sell may be empty.

Regardless, here's the basics. We can break this discussion into two bits: data and rendering

Data

Some of our device pages have schematics on them. For example:
https://www.ifixit.com/Device/Makita_Chain_Saw_EA6100PR_2017
https://www.ifixit.com/Device/Toro_Stump_Grinder_22615HD_2018
https://www.ifixit.com/Device/Dewalt_Impact_Wrench_DCF899HB_2016

On ifixit, we also can link to a specific diagram:
https://www.ifixit.com/Device/Makita_Chain_Saw_EA6100PR_2017#diagram/16072

Schematics are comprised of 0-n diagrams and an additional list of parts not associated with a diagram. They are represented by the diagrams field on the API endpoint for devices:
https://www.ifixit.com/api/2.0/wikis/CATEGORY/Barreto_Trencher_E718MTH4S_2016
https://www.ifixit.com/api/2.0/wikis/CATEGORY/Makita_Chain_Saw_EA6100PR_2017

That endpoint should give you enough information to render a summary view of a schematic:
image

Each diagram contains an image and a set of data points that indicate what each component on the diagram is. You can fetch all this information about a diagram from the diagrams endpoint:
https://www.ifixit.com/api/2.0/diagrams/16072

The diagram endpoint returns JSON that looks like this:
image

That should give you enough information to render a full diagram view:
https://www.ifixit.com/Device/Makita_Chain_Saw_EA6100PR_2017#diagram/16072

image

The data field on the digrams endpoint represents the coordinates on the image. Each coordinate has an X-Y location and radius which represents where the data point is on the image. There can also be 1 or more items on the data point. An item represents a physical part that goes in a device, like a battery, belt, bolt, wheel, screen, etc. Generally, those are the things we sell. Every item on a diagram has a corresponding Item wiki (https://www.ifixit.com/Item/Makita_Suction_Head_Dpc7001_010114010):
image

Rendering

Okay, so we have all this great structured data that represents what parts go in which devices. How do we display it all?

We built a custom diagram viewer to address this solution. We've been wanting to open source it for a couple months, however the issue to actually make that component available has not been prioritized. We can look at getting that done soon. CC @jarstelfox @MilesRobinson

@dhmacs
Copy link
Contributor Author

dhmacs commented Jul 28, 2021

Sure thing! As of right now, I don't think you'll get much use out of it because the set of devices for which we have schematics and parts to sell may be empty.

Ok then I'll pause this task until we figure out the data side.

On ifixit, we also can link to a specific diagram:
https://www.ifixit.com/Device/Makita_Chain_Saw_EA6100PR_2017#diagram/16072

Oh wow, this is really cool! 💯 I like the idea, it looks like a great shopping experience too 👍

@dhmacs dhmacs closed this as completed Aug 4, 2021
@dhmacs dhmacs added this to the v1 milestone Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants