Templarian / MaterialDesign-Site

Site v2.0. This repo contains the site and admin, so little confusing.
http://dev.materialdesignicons.com
36 stars 33 forks source link

Suggestions for similar icons #71

Closed ofekashery closed 3 years ago

ofekashery commented 6 years ago

In the dialog information about the icon, there will be suggestions for more similar icons, such as outline for this icon. I'll try to develop it.

ofekashery commented 6 years ago

You can run a test if the same name exists with another "key". sample: hello hello-outline hello-box

Templarian commented 6 years ago

Definitely could do that, but to make it a bit more performant for us going forward we've been investigating adding a table to track 'modifiers'.

A toggle for [Regular | Outline | Light] on... https://dev.materialdesignicons.com/icon/access-point

Then it would also allow adding a query to find the variations (box, circle, etc).

Table: style
| id      | name      |
| uuid    | "outline" |
| uuid    | "light"   |
| uuid    | "outline" |

Table: style_group (this isn't really needed, so may leave it out)
| id     |
| uuid   |

Table: icon_style
| id     | icon_id  | style_id | style_group_id |
| uuid   | uuid     | uuid     | uuid           |
| uuid   | uuid     | uuid     | uuid           |
| uuid   | uuid     | uuid     | uuid           |

This would allow us to relatively quickly query based on the icon's style group to get the related

GET api/icon/:iconId?styles=outline,light,box,circle,etc
GET api/package/:packageId/:iconName?styles=outline,light,box,circle,etc

It may also let us simply show all icons with box or circle more quickly.

https://dev.materialdesignicons.com/contribute/site/api

(note, typed this relatively fast, so there may be errors above, busy at work today)

Templarian commented 6 years ago

Heading to the bar, but I think we could also just add a column to the icon table for style and maybe assign a parentId.

I'm just wondering if this limits us too much by making the assumption there is always a base icon (vs a group).

account, account-box (parent icon id would be `account) for instance.

If there was no account, but not sure if we have a situation like that.

Templarian commented 6 years ago

Progress update.

Added 1 new endpoint and added the styles[] array to the icon related endpoints that return a single icon.

Public Endpoints

https://dev.materialdesignicons.com/contribute/site/api#get-a-list-of-styles (new) https://dev.materialdesignicons.com/contribute/site/api#get-icon-by-name (updated)

Example: https://dev.materialdesignicons.com/api/package/38EF63D0-4744-11E4-B3CF-842B2B6CFE1B/name/account-circle-outline

Private Endpoints

I'm adding admin related management tools for this right now and the Core team will be as quickly as possible updating all icons to include style and baseIconIds.

Next Steps

I'll be introducing a new baseIconId column in the database. This will be by default assigned to the same value as icon.id.

For instance lets say account-circle-outline would have the baseIconId of the account icons icon.id.

But account will have the baseIconId of account (self referenced).

We can then query all related icons very quickly by simply looking for all baseIconId's that are the same. This will give the feature I think you're aiming for!

It also allows us to quickly query all icons by style in a given package.

GET api/package/:packageId?style=outline,circle

Tomorrow I'll be writing up the admin features and wrapping up the UI for them and we'll try and get this into the next release for meta.json also. Probably normalized like tags and aliases.

Templarian commented 6 years ago

Another new endpoint to get all base icons.

https://dev.materialdesignicons.com/contribute/site/api#get-base-icons-by-base-icon-id (new)

Ex: https://dev.materialdesignicons.com/api/icon/E76EC23F-AB71-49B3-9173-841544527A20/base

Still updating the admin tools, but the related icon page uses the above endpoint for "Related Icons".

https://dev.materialdesignicons.com/icon/account-circle-outline

Templarian commented 6 years ago

All the core contributors are now working toward adding all the data.

Screenshot below. It's an internal admin feature so not spending too much time on design.

screenshot

Task left is to code up the endpoint that allows returning icons by style list. Will work on that this week if I don't play Fallout 4 / Red Dead Redemption 2.

JamesCoyle commented 6 years ago

Progress on adding the data to icons.

Templarian commented 3 years ago

Pictogrammers will be where we manage all the site work in the future. This repository will be archived.

https://github.com/Pictogrammers/Icon-Site/issues