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

Add shape filter UI button #329

Merged

Conversation

VijayanB
Copy link
Member

@VijayanB VijayanB commented Mar 7, 2023

Description

Add spatial filter toolbar with polygon button. This will just accept input and save it in map container.
Later DrawFilter Component will render draw polygon feature.

Issues Resolved

#213

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Screen.Recording.2023-03-07.at.2.48.42.PM.mov

This will contain properties that are common to
all layers.

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
@VijayanB VijayanB requested a review from a team March 7, 2023 23:05
@VijayanB VijayanB force-pushed the add-shape-filter-ui-button branch from f5be7cc to 03f6003 Compare March 7, 2023 23:34
};

return (
<EuiPanel style={{ maxWidth: 300, border: 'hidden' }}>
Copy link
Member

Choose a reason for hiding this comment

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

Shall we move the style to css file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ack

common/index.ts Outdated
Comment on lines 151 to 154
export enum FILTER_DRAW_MODE {
NONE = 'none',
POLYGON = 'polygon',
}
Copy link
Member

Choose a reason for hiding this comment

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

Could you provide some words on what's the NONE and POLYGON mean?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ack

This will add polygon button which provides context menu
to select parameters like relation, label.

Add cancel button if it starts drawing.

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
@VijayanB VijayanB force-pushed the add-shape-filter-ui-button branch from 03f6003 to 19860e6 Compare March 8, 2023 00:06
@VijayanB VijayanB requested a review from junqiu-lei March 8, 2023 00:09
Comment on lines +151 to +160
export enum FILTER_DRAW_MODE {
NONE = 'none', // draw filter is inactive
POLYGON = 'polygon', // Filter is active and set to draw polygon
}

export interface DrawFilterProperties {
relation?: string;
mode: FILTER_DRAW_MODE;
filterLabel?: string;
}
Copy link
Member

Choose a reason for hiding this comment

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

How about introduce a prop isDrawActive, the mode only contains different type of draw.

enum FILTER_DRAW_MODE {
  POLYGON = 'polygon', // Filter is active and set to draw polygon
  CIRCLE='circle',
}

export interface DrawFilterProperties {
  relation?: string;
  isDrawActive: boolean
  mode: FILTER_DRAW_MODE;
  filterLabel?: string;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Good suggestion. Then we have to maintain two variable for 1 behavior. For ex: if draw is false, then i have to reset mode to null, similarly if we want to enable draw behavior, we have to set to true and set mode accordingly.

@VijayanB VijayanB requested a review from junqiu-lei March 8, 2023 02:06
@VijayanB VijayanB self-assigned this Mar 8, 2023
@VijayanB VijayanB merged commit 9fffd01 into opensearch-project:main Mar 8, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 8, 2023
* Add spatial filter toolbar

This will add polygon button which provides context menu
to select parameters like relation, label.

Add cancel button if it starts drawing.

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
(cherry picked from commit 9fffd01)
VijayanB pushed a commit that referenced this pull request Mar 8, 2023
* Add spatial filter toolbar

This will add polygon button which provides context menu
to select parameters like relation, label.

Add cancel button if it starts drawing.

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
VijayanB pushed a commit to VijayanB/dashboards-maps that referenced this pull request Mar 20, 2023
…ct#331)

* Add spatial filter toolbar

This will add polygon button which provides context menu
to select parameters like relation, label.

Add cancel button if it starts drawing.

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
(cherry picked from commit 9a07356)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants