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

Emoji selectors #31

Open
emanuelbuholzer opened this issue Jan 8, 2017 · 20 comments
Open

Emoji selectors #31

emanuelbuholzer opened this issue Jan 8, 2017 · 20 comments
Labels
status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request

Comments

@emanuelbuholzer
Copy link

It would be very useful if the API could provide selector functions which allow the user to get all emojis and these of a given category. What do you think?

I'd work on that if everybody agrees 😃

@omnidan
Copy link
Owner

omnidan commented Jan 9, 2017

This would be interesting, especially for applications that let users pick emoji. A PR would be very welcome 😁

@emanuelbuholzer
Copy link
Author

Yes that's why I'd need it. Okay, so I'll start working on it.

@emanuelbuholzer
Copy link
Author

I just checked out the code and this will be a lot of repetitive boring work. Does anyone have an idea to do this without a simple manual made mapping table?

If not, I'll do the manual work 😭

@omnidan
Copy link
Owner

omnidan commented Jan 9, 2017

@emanuelbuholzer maybe you can find a list that groups emoji in categories, e.g. on a website - then you could automatically read this into a category: [emoji, ...] mapping with a little bit of JS magic ✨

@emanuelbuholzer
Copy link
Author

emanuelbuholzer commented Jan 18, 2017

After some more, I stillt haven't found a way of grouping them together automatiaclly. I'll put this into the list of "things I'll do at a suitable time in the future". I'll put all work into a branch - if anyone want's to help

@omnidan omnidan added the status: accepting prs Please, send a pull request to resolve this! label Jan 19, 2017
@abdurrahmanekr
Copy link

@omnidan, I actually sorted the emoji array. And succeeded. This is the sorted array, like:

const emoji = require('node-emoji')
// array transfer
var result = [];
for (var i in emoji.emoji)
	result.push(emoji.emoji[i])
// sort
result = result.sort();
// People category 1156 to 1236 (Namely 80 pieces)
result = result.slice(1156, 1236)
// end
result == ["😀", "😁", "😂", "😃", "😄", "😅", "😆", "😆", "😇", "😈", "😉", "😊", "😋", "😌", "😍", "😎", "😏", "😐", "😑", "😒", "😓", "😔", "😕", "😖", "😗", "😘", "😙", "😚", "😛", "😜", "😝", "😞", "😟", "😠", "😡", "😢", "😣", "😤", "😥", "😦", "😧", "😨", "😩", "😪", "😫", "😬", "😭", "😮", "😯", "😰", "😱", "😲", "😳", "😴", "😵", "😶", "😷", "😸", "😹", "😺", "😻", "😼", "😽", "😾", "😿", "🙀", "🙁", "🙂", "🙃", "🙄", "🙅", "🙆", "🙇", "🙈", "🙉", "🙊", "🙋", "🙌", "🙍", "🙎"]

@emanuelbuholzer
Copy link
Author

Thanks, that makes the whole process a lot easier. I'll work on category support in the next few days.

@emanuelbuholzer
Copy link
Author

If everybody agrees I'll implement categories according to recommended sort order, which is the default ordering of emoji characters from Unicode CLDR data.

For more information about the categories visit: http://unicode.org/emoji/charts/emoji-ordering.html

@abdurrahmanekr
Copy link

@emanuelbuholzer Looks good to me 👍

@omnidan
Copy link
Owner

omnidan commented Jul 4, 2017

@emanuelbuholzer looks good 👍 would be nice if you could implement category support and submit a PR 😁

@emanuelbuholzer
Copy link
Author

emanuelbuholzer commented Jul 11, 2017

I started working on category support. If I'd implement it according to the source above (http://unicode.org/emoji/charts/emoji-ordering.html), the technique for getting emojis showed by @abdurrahmanekr would not work. It looks like the ordering isn't the same as the ordering within the Unicode CLDR data, furthermore it looks like some emojis are missing.

As an alternative I could implement category support like within most emoji keyboards/selectors or we could refactor the codebase, so that it is close to the Unicode CLDR data. What do you all think?

@smeijer
Copy link

smeijer commented Jul 15, 2017

I think this file can be useful. As it seems to me that they've already categorized based on unicode. In that case, we can simply update the build script, and leave some credit.

https://github.com/OneSignal/emoji-picker/blob/master/lib/js/config.js#L851

@Gotemperor
Copy link

Some icons are not showing, why?

@smeijer
Copy link

smeijer commented Sep 5, 2017

Do you have an example @Gotemperor?

@Gotemperor
Copy link

I am using localhost on my linux machine, so I can not gice you an example, but I see also missing icons when I open the github repository examples, they look like that
, "🙁", "🙂", "🙃", "🙄", "🙅", "🙆", "🙇", "🙈", "🙉", "🙊", "🙋", "🙌", "🙍", "🙎"

@Gotemperor
Copy link

hmm, strange, they look ok here, but not ok on my localhost, can it be related to my localhost, to linux, or to missing font files? I used npm to install

@omnidan
Copy link
Owner

omnidan commented Sep 5, 2017

@Gotemperor github defines fallback images for unsupported emoji. it seems like your platform does not support the latest emoji set. I tried running the example code on macOS 10.12.6 and they all show up fine for me (in the console).

@GaryTowers
Copy link

Hey guys, I noticed this is an old post. Did this feature get considered on any release? @emanuelbuholzer is this something you are still working on?

@Richienb
Copy link
Collaborator

@GaryTowers I'm pretty sure emojilib proves data for this to be possible. If we were to add this to node-emoji it would be using it.

@wdfinch
Copy link

wdfinch commented Mar 24, 2020

@GaryTowers I wrote a script to parse a json file with emojis and their respective categories. I uploaded the script and the json output to wdfinch/emojis-json-formatted.

In the json folder, you'll find a file containing a bunch of emojis organized by category and sub-category. Additionally, you'll find a file that contains a single large json object in a compatible format with this library.

Let me know if this works for you.

@JoshuaKGoldberg JoshuaKGoldberg added the type: feature New enhancement or request label May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request
Projects
None yet
Development

No branches or pull requests

9 participants