Git Product home page Git Product logo

Comments (6)

leo-step avatar leo-step commented on May 23, 2024 1

The issue is in this line:

if (highestFrequency / 3 < 1) {

The colors will only show up if a given company has a category of questions (e.g. heap) that has a frequency of at least three. I tested this with Airbnb by adding the company and the "Heap" pattern to the first question in questions.json (Contains Duplicate), and the colors immediately show for all of them.

Screen Shot 2022-08-13 at 11 28 54 PM

How do we want the colors to be in these cases?

from leetcode-patterns.

seanprashad avatar seanprashad commented on May 23, 2024

Steps to reproduce:

  1. Select any company from the dropdown list under Companies
  2. Observe the pills under Problems pattern frequency

Possibly related to either https://github.com/seanprashad/leetcode-patterns/pull/214/files#diff-9aa6b25aa4aab24215ebcedc56e0ff3c2a2e481a30b42eb3ca0fcce2c7752789R402 or #227

from leetcode-patterns.

seanprashad avatar seanprashad commented on May 23, 2024

One problem that I see here is from a UX perspective - the colouring is also used in the Difficulty column to denote Easy/Medium/Hard questions.

Here, we use the same colour schema, but for a different purpose:

const frequencyRate = {
easy: Math.round(highestFrequency / 3),
medium: Math.round((highestFrequency / 3) * 2),
hard: highestFrequency,
};

Since we have two different contexts, we should look into a better colouring scheme when revisiting this!

from leetcode-patterns.

seanprashad avatar seanprashad commented on May 23, 2024

More breadcrumbs:

className={`${getFrequencyClass(patternsMap[pattern])}`}

from leetcode-patterns.

seanprashad avatar seanprashad commented on May 23, 2024

Looks like some companies, like Apple, show up correctly:
image

from leetcode-patterns.

seanprashad avatar seanprashad commented on May 23, 2024

How do we want the colors to be in these cases?

Hmm well, I'm not sure to be honest. Ideally, I think some sort of coloured gradient would look nice, where a darker shade maps to a pattern that is more frequent. There's a bunch of websites to help do the CSS, like https://coolors.co/gradient-maker.

Edit: On second thought, let's choose something easy - red if the frequency is >=5 and orange for everything else. We can fiddle around with an appropriate colour scheme after fixing this bug!

from leetcode-patterns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.