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(#64): Create a facet panel for data exploration #95

Merged
merged 23 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dbedcf8
#64: Removed dangling css code
tholulomo Feb 2, 2022
a529ba3
#64: Updated global app css
tholulomo Feb 2, 2022
a696b79
#64: Added flat input styling
tholulomo Feb 4, 2022
88cf816
#64: Updated button styling
tholulomo Feb 4, 2022
01d0e36
#64: Updated styling for facet panel
tholulomo Feb 4, 2022
07f4658
#64: Append facet import to existing component
tholulomo Feb 4, 2022
2f06dcb
#64: Added src code for facet panel
tholulomo Feb 4, 2022
77a2f48
#64: Updated global state with facet
tholulomo Feb 4, 2022
c8b09ee
#64: Update header to return to home if search string is empty
tholulomo Feb 4, 2022
4e8d0ab
Merge branch 'develop' of github.com:Duke-MatSci/materialsmine into #…
tholulomo Feb 7, 2022
ca79bbd
#64: Updated facet opacity
tholulomo Feb 7, 2022
26f315f
#64: Updated facet code to trigger on component mount instead of wind…
tholulomo Feb 7, 2022
3b0e47d
#64: Mounting facetjs on component load
tholulomo Feb 7, 2022
7742bfc
#64: Removed facetjs import from base component
tholulomo Feb 7, 2022
55970c7
#64: Removed browse data from drawer
tholulomo Feb 7, 2022
e15a307
#64: Updated incorrect redirect at global not found
tholulomo Feb 7, 2022
6cf531f
#64: Removed unused component import
tholulomo Feb 7, 2022
b46b15d
#64: Linting error fixes
tholulomo Feb 7, 2022
d539491
#64: Added lodash for testing purpose
tholulomo Feb 7, 2022
f9a2425
#64: Created a re-usable wrapper for testing
tholulomo Feb 7, 2022
2712bad
#64: Adjusted indentation
tholulomo Feb 7, 2022
98d8c08
#64: Refactor tests code to use the new re-usable wrapper
tholulomo Feb 7, 2022
a38b5b1
#64: Linter fixes
tholulomo Feb 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"eslint-plugin-vue": "^6.2.2",
"jest-serializer-vue": "^2.0.2",
"lint-staged": "^9.5.0",
"lodash": "^4.17.21",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"sinon": "^12.0.1",
Expand Down
8 changes: 1 addition & 7 deletions app/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,5 @@
</template>

<style lang="scss">
@import 'assets/css/style.scss';
#app {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: $primary;
background-color: $primary-white;
}
@import 'assets/css/style.scss';
</style>
5 changes: 3 additions & 2 deletions app/src/assets/css/base/_reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ img {
text-shadow: none;
}

#nanomine_app,
#metamine_app {
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
background-color: white;
color: $primary;
background-color: $primary-white;
}
86 changes: 86 additions & 0 deletions app/src/assets/css/modules/_facet.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
.facet {
z-index: 9;
background-color: $primary-white;
border: 1px solid #d3d3d3;
text-align: center;
min-height: 60px;
min-width: 320px;
max-height: 500px;
max-width: 600px;
opacity: 0;

&_viewport {
width: 100%;
display: inline-block;
vertical-align: top;
overflow: auto;
border: 1px solid rgba(#000, .12);
}

&_active {
opacity: 0.8;
}
}

/*Drgable */

.facet {
position: absolute;
/*resize: both; !*enable this to css resize*! */
overflow: auto;
}

.md-subheader.facet-header {
min-height: 35px;
padding: 5px;
cursor: move;
z-index: 10;
background-color: $primary;
color: $primary-white !important;
font-weight: bold;
margin-bottom: .2rem;
}

/*Resizeable*/
.facet .resizer-right {
width: 5px;
height: 100%;
background: transparent;
position: absolute;
right: 0;
bottom: 0;
cursor: e-resize;
}

.facet .resizer-bottom {
width: 100%;
height: 5px;
background: transparent;
position: absolute;
right: 0;
bottom: 0;
cursor: n-resize;
}

.facet .resizer-both {
width: 5px;
height: 5px;
background: transparent;
z-index: 10;
position: absolute;
right: 0;
bottom: 0;
cursor: nw-resize;
}

/*NOSELECT*/
.facet * {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
supported by Chrome and Opera */
}

25 changes: 25 additions & 0 deletions app/src/assets/css/modules/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,31 @@
border: .15rem solid $tertiary;
}
}

&--flat {
border: none;
border-bottom: .15rem solid $primary-white;
font-size: inherit;
color: $primary-white;
background-color: transparent;
padding: .5rem .2rem;

&:focus {
border-bottom: .15rem solid $primary-white;
background-color: transparent;
}

&:focus:invalid {
border-bottom: .15rem solid $tertiary;
}
&::-webkit-input-placeholder {
color: $primary-white;
}

&-label {
color: $primary-white;
}
}
}


Expand Down
2 changes: 1 addition & 1 deletion app/src/assets/css/modules/_pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
&_btn {
display: block !important;
padding: 1.5rem 3.5rem !important;
padding: 1.65rem 3.5rem !important;
font-size: 1.2rem;
&:hover {
transform: translateY(0) !important;
Expand Down
8 changes: 7 additions & 1 deletion app/src/assets/css/modules/_utility.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
}

.u {
&_width--small {
width: 15rem;
}
&--bg {
background-color: $primary !important;
color: $primary-white !important
Expand Down Expand Up @@ -83,8 +86,11 @@
}

&_margin-top {
&-small {
margin-top: 1rem !important;
}
&-med {
margin-top: 3.1rem !important;
margin-top: 3.2rem !important;
}
}

Expand Down
1 change: 1 addition & 0 deletions app/src/assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@import './base/_reset.scss';
@import './base/_grid.scss';
@import './modules/_button.scss';
@import './modules/_facet.scss';
@import './modules/_footer.scss';
@import './modules/_form.scss';
@import './modules/_header.scss';
Expand Down
21 changes: 21 additions & 0 deletions app/src/components/explorer/Facet.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<template>
<div :class="{facet: true, facet_active: searchEnabled}">
<div class="facet_viewport">
<md-list>
<md-subheader class="md-primary facet-header">Filter Panel</md-subheader>
<md-divider></md-divider>
<slot >Default Test</slot>
</md-list>
</div>
</div>
</template>
<script>
import Facet from '@/modules/facet.js'
export default {
name: 'FacetPanel',
props: ['searchEnabled'],
mounted () {
Facet()
}
}
</script>
26 changes: 19 additions & 7 deletions app/src/components/explorer/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
<md-app-toolbar class="md-large md-dense md-primary" id="reset_bg">
<div class="md-toolbar-row">
<div class="md-toolbar-section-start">
<md-button class="md-icon-button" @click="toggleMenu">
<md-button class="md-icon-button" @click="toggler">
<md-icon>menu</md-icon>
</md-button>

<span class="md-title"><img id="logo" src="@/assets/img/materialsmine_logo_sm.png"></span>
</div>

<div class="md-toolbar-section-end">
<!-- <md-button class="md-icon-button">
<md-icon>more_vert</md-icon>
</md-button> -->
<div class="u_margin-top-small u_width--small u_margin-right-small" v-if="searchEnabled">
<input type="text" class="form__input form__input--flat" placeholder="Searching..." name="search" id="search" v-model="searchTerm" />
<label htmlFor="search" class="form__label form__input--flat-label">Searching...</label>
</div>
<md-badge id="header-badge" class="md-primary" md-content="12">
<md-avatar>
<img src="@/assets/img/brinson.jpeg" alt="Avatar">
Expand All @@ -36,9 +37,20 @@
export default {
name: 'ExpHeader',
props: ['toggler'],
methods: {
toggleMenu () {
this.toggler()
computed: {
searchTerm: {
get () {
return this.$store.getters['explorer/getSearchKeyword']
},
set (payload) {
this.$store.commit('explorer/setSearchKeyword', payload)
if (!payload) {
this.$store.commit('explorer/setSearching')
}
}
},
searchEnabled () {
return this.$store.getters['explorer/getSearching']
}
}
}
Expand Down
1 change: 0 additions & 1 deletion app/src/components/nanomine/Drawers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<md-icon class="utility-navfonticon">view_comfy</md-icon>
<span class="md-list-item-text utility-navfont">Visualize</span>
<md-list slot="md-expand">
<md-list-item class="md-inset">Browse Data</md-list-item>
<md-list-item class="md-inset">Chart Gallery</md-list-item>
<md-list-item class="md-inset">Image Gallery</md-list-item>
</md-list>
Expand Down
Loading