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

[Feat] allow for multiple value column type #1666

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

crabatel
Copy link

  • add array type matching
  • add array parsing
  • add array ordinal domain generation

@crabatel crabatel force-pushed the add-multiple-value-column branch 2 times, most recently from 8deca7e to e42bd58 Compare December 21, 2021 15:00
@heshan0131
Copy link
Contributor

Please git rm dist from your commit.

@@ -214,8 +214,6 @@
"prettier": "1.19.1",
"progress-bar-webpack-plugin": "^2.1.0",
"puppeteer": "^2.1.1",
"react": "^16.8.4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why this is removed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,
Actually I removed this because I thought having react as a dependency there was the cause of an error when trying to npm link the Kepler package (@see https://stackoverflow.com/questions/66975613/error-invalid-hook-call-hooks-can-only-be-called-inside-of-the-body-of-a-funct), but it appeared it wasn't the reason as we could not get rid of this error.

As we could not npm link we resolved to pushing the dist/ folder on our repo and updating our dependency to point to our repo, hence the presence of the dist/ folder.

Concerning this PR, we were not sure it could be accepted as we made the assumption that an array typed column in the CSV would be in a JSON format. This is the format we decided to use for our project, but it may not be the case for everyone, and maybe it should be discussed.

If the changes can be accepted, I'll remove the dist/ from this branch as well as the dependency change.

return data => filter.value.includes(valueAccessor(data));
return data => {
const value = valueAccessor(data);
if (Array.isArray(value)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make this function more efficient, we should do the checking out side the data => boolean function

case FILTER_TYPES.multiSelect:
return feld.type === ALL_FILED_TYPES.array ? data => {
  const value = valueAccessor(data);
  return Array.isArray(value) && value.some(v => filter.value.includes(v));
} : data => filter.value.includes(valueAccessor(data));

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed it's better, I'll update this one.

@@ -1,8 +1,10 @@
name: Node.js Package

on:
release:
types: [created]
push:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, sorry for that

package.json Outdated
@@ -1,8 +1,8 @@
{
"name": "kepler.gl",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove changes to package.json

@@ -46,7 +46,7 @@ import {TOOLTIP_FORMAT_TYPES} from './tooltip';
import {LAYER_TYPES} from 'layers/types';

export const ACTION_PREFIX = '@@kepler.gl/';
export const CLOUDFRONT = 'https://d1a3f4spazzrp4.cloudfront.net/kepler.gl';
export const CLOUDFRONT = 'https://raw.githubusercontent.com/datatlas-erasme/front/master/src/src/static/';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

@@ -30,7 +30,7 @@ import {getTextOffsetByRadius, formatTextLabelData} from '../layer-text-label';

const brushingExtension = new BrushingExtension();

export const SVG_ICON_URL = `${CLOUDFRONT}/icons/svg-icons.json`;
export const SVG_ICON_URL = `${CLOUDFRONT}/icons.json`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove here

lutangar added a commit to datatlas-erasme/kepler.gl that referenced this pull request Jan 6, 2023
> fix keplergl#1637 and supersede keplergl#1666

Allow to import features with multiple values properties and convert them to an `array` type.
These fields can then be picked as filters or shown in the tooltip.
lutangar added a commit to datatlas-erasme/kepler.gl that referenced this pull request Jan 6, 2023
> fix keplergl#1637 and supersede keplergl#1666

Allow to import features with multiple values properties and convert them to an `array` type.
These fields can then be picked as filters or shown in the tooltip.
lutangar added a commit to datatlas-erasme/kepler.gl that referenced this pull request Jan 6, 2023
> fix keplergl#1637 and supersede keplergl#1666

Allow to import features with multiple values properties and convert them to an `array` type.
These fields can then be picked as filters or shown in the tooltip.

Signed-off-by: lutangar <johan.dufour@gmail.com>
lutangar added a commit to datatlas-erasme/kepler.gl that referenced this pull request Feb 1, 2023
> fix keplergl#1637 and supersede keplergl#1666

Allow to import features with multiple values properties and convert them to an `array` type.
These fields can then be picked as filters or shown in the tooltip.

Signed-off-by: lutangar <johan.dufour@gmail.com>
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

Successfully merging this pull request may close these issues.

None yet

3 participants