-
Notifications
You must be signed in to change notification settings - Fork 62
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
DataLovers POKENDIA GO! #37
Open
YazTepRod
wants to merge
20
commits into
Laboratoria:master
Choose a base branch
from
YazTepRod:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 14 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
1d39a00
prueba
vanyaxel 5f49205
Quité carpetas del resto de proyectos Data Lovers
YazTepRod 0936ab1
Merge branch 'master' of https://github.com/YazTepRod/CDMX009-Data-Lo…
YazTepRod fc63ed1
maquetacion-html
vanyaxel f796e8a
maquetacion-html
vanyaxel 4b7ddc8
Trabajo en CSS, modificaciones en html
YazTepRod f631a55
Trabajo en CSS y función para cambio de pantallas
YazTepRod d44060f
css y js
vanyaxel 6d55e4b
css y js
vanyaxel 1b15720
css modificaciones
vanyaxel 84df0b6
lista pokemon en section
vanyaxel d2f2b80
modal creado
vanyaxel 860a734
archivos pruebas borrados
vanyaxel ace7bc6
Se visualiza el ordenado y filtrado y las tarjetas donde se visualiza…
YazTepRod 55a130e
intento de filtrado
vanyaxel a2a86d5
intento filtrado
vanyaxel dfa1c2e
filtrado
vanyaxel 8b1d6cc
filtrado y ordenado logrado
vanyaxel 88cc405
Read me
vanyaxel 7443a4a
Readme
vanyaxel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,58 @@ | ||
// import data from './data/injuries/injuries.js'; | ||
// import data from './data/lol/lol.js'; | ||
// import data from './data/patient/patient.js'; | ||
// import data from './data/pokemon/pokemon.js'; | ||
// import data from './data/rickandmorty/rickandmorty.js'; | ||
// import data from './data/steam/steam.js'; | ||
// import data from './data/steam/worldbank.js'; | ||
|
||
// esta es una función de ejemplo | ||
|
||
export const example = () => { | ||
return 'example'; | ||
//Ordenado | ||
const sortData = (data, sortBy, sortOrder) => { | ||
let arrOrdPok = []; //Array Ordenar Pokemones | ||
|
||
/* Orden Alfabetico descendente y ascendente */ | ||
if (sortBy === 'name') { | ||
if (sortOrder === 'A-Z') { | ||
arrOrdPok = data.sort(function(abc, bcd) { | ||
if (abc.name > bcd.name) return 1; | ||
if (abc.name === bcd.name) return 0; | ||
return -1; | ||
}); | ||
|
||
} else { | ||
arrOrdPok = data.sort(function(abc, bcd) { | ||
if (bcd.name > abc.name) return 1; | ||
if (bcd.name === abc.name) return 0; | ||
return -1; | ||
}); | ||
} | ||
|
||
/* Orden por ID */ | ||
} else if (sortBy === 'number') { | ||
if (sortOrder === 'asc') { | ||
arrOrder = data.sort(function(abc, bcd) { | ||
if (abc.id > bcd.id) return 1; | ||
if (abc.id === bcd.id) return 0; | ||
return -1; | ||
}); | ||
} else { | ||
arrOrdPok = data.sort(function(abc, bcd) { | ||
if (bcd.id > abc.id) return 1; | ||
if (bcd.id === abc.id) return 0; | ||
return -1; | ||
}); | ||
} | ||
} | ||
return arrOrdPok; | ||
}; | ||
|
||
//Filtrado | ||
const filterData = (data, condition) => { | ||
let arrType = []; | ||
for (let i = 0; i < data.length; i++) { | ||
for (let x = 0; x < data[i].type.length; x++) { | ||
if (data[i].type[x] === condition) { | ||
arrType.push(data[i]); | ||
} | ||
} | ||
} | ||
return arrType; | ||
}; | ||
|
||
window.poke= { | ||
sortData, | ||
filterData | ||
}; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Muy buen trabajo! |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pregunta, a qué se refieren los parámetros abc, bcd? Me parece que podrían tener nombres más descriptivos :)