blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
132
path
stringlengths
3
236
src_encoding
stringclasses
29 values
length_bytes
int64
8
7.94M
score
float64
2.52
5.72
int_score
int64
3
5
detected_licenses
listlengths
0
142
license_type
stringclasses
2 values
text
stringlengths
8
7.94M
download_success
bool
1 class
191c6dc8ac64e114d650e10cec07252bcb1b0e3d
JavaScript
JeanSisse/Back-End-desafio-modulo-II
/src/controladores/conta.js
UTF-8
5,688
2.828125
3
[]
no_license
const { banco: { senha: senhaGerente }, contas } = require('../bancodedados'); function isNotEmpty(body) { for (const x in body) { return true; } return false; } function validarCliente(cliente) { if (!cliente.nome) { return 'O campo \'nome\' é obrigatório!'; } if (!cliente.cpf) { return 'O ...
true
1d6c86f1eaa6de4b948928945bdd68fa7ae43dec
JavaScript
nitish24p/take-a-break
/popup.js
UTF-8
3,056
2.875
3
[ "MIT" ]
permissive
function Timer() { this.button = document.querySelector('.button'); this.toggle = document.querySelector('.toggle-switch'); this.storage = chrome.storage.local; this.inputField = document.querySelector('.inputfield'); this.actions = document.querySelector('.actions'); this.body = document.querySelector('bo...
true
0d02c720cffe62deac52e849e666716fde03bb43
JavaScript
galexynye/midi-sequencing
/gatsby-node.js
UTF-8
6,899
2.796875
3
[]
no_license
const _ = require('lodash') const Promise = require('bluebird') const path = require('path') const { createFilePath } = require('gatsby-source-filesystem') exports.createPages = async ({ graphql, actions, reporter }) => { const { createPage } = actions const blogPost = path.resolve('./src/components/05_page/Blu...
true
dd3ece0ef83902701ee2f750d573ffda1d19a4c5
JavaScript
RashedMigdady/Reduce-Filter
/reduce&filter.js
UTF-8
6,914
4.5
4
[]
no_license
console.log('Here is : ', 'Reduce & Filter'); //Using Reduce 1 -5 var persons = [ { name: { first: 'John', last: 'Hob' }, age: 35 }, { name: { first: 'Alex', last: 'Mercer' }, age: 25 }, { name: { first: 'Alice', last: 'Zjjjjjjjjjaheer' }, age: 24 }, { name: { first: 'Zues', last: 'Odin' }, age: 55 }, { name...
true
1019ed769583fd4688346d0de29e886445d3dbb2
JavaScript
juliana176/EJERCICIOS-ARRAY
/ejemplo11.js
UTF-8
1,621
4.40625
4
[]
no_license
/*Realizar un programa que ayude a calcular el total a pagar de acuerdo a la distancia recorrida por un vehículo con cargo extra por los litros consumidos, tomando en consideración lo siguiente: Si el vehículo es “coche”, el precio kilometro ha de ser 0.20, si es “moto” ha de ser 0.10 y si es “autobús” 0.5. Si los lit...
true
9478a72c6506c07cb9e5225f4e7c9e55c25415fc
JavaScript
finnishandy/ES6
/lodash/stats.js
UTF-8
1,613
3.515625
4
[]
no_license
/** * Created by Sakari.Ruoho on 21/12/2015. */ var _ = require('lodash'); function Person(first, last, nationality) { this.firstname = first; this.lastname = last; this.nationality = nationality; } Person.prototype.getFullName = function () { return [this.firstname, this.lastname].join(' '); }; Per...
true
610e99cc55863037eda084e23c048db69cea3712
JavaScript
lsudigitalart/2019-2210-hw8-Ace601
/sketch2.js
UTF-8
1,748
3.4375
3
[]
no_license
let img0, img1, img2, img3; let x0 = 0 let y0 = 0 let x1 = 0 let y1 = 0 function preload(){ img0 = loadImage('themonster1.png'); img1 = loadImage('themonster2.png'); img2 = loadImage('Monster4.png'); img3 = loadImage('dod.png'); } function setup() { createCanvas(3500,3500) } fu...
true
bf2c8d09f46e3e43f5bcc18fd0206b437b849935
JavaScript
Shatki/dg-test
/src/property/property.js
UTF-8
3,664
2.59375
3
[]
no_license
import React from 'react'; import { DataGrid, GridColumn, Tooltip, TextBox, SwitchButton } from 'rc-easyui' export default class PropertyGrid extends React.Component { constructor(props) { super(props); this.state = { data: this.getData() }; this.cellErrorMessage = "Wron...
true
895c11bee9f90f5552f121b965238d1dde503e04
JavaScript
Vineti-Internship/intro-to-redux
/pure-redux/reducer.js
UTF-8
768
2.90625
3
[]
no_license
const initialTodoState = []; const todoReducer = (state = initialTodoState, action) => { console.log('state' ,state); switch (action.type) { case 'ADD_TODO': return [...state, action.payload] // case 'DELETE_TODO': // const currentTodos = [...state.todos]; // currentTodos.splice(action.pa...
true
1033eb09fbd3915a3ef3b9657fc7aed667401ef9
JavaScript
brianshourd/js-clank
/clank.js
UTF-8
3,850
2.625
3
[]
no_license
// Use UMD, so it should work with Node, AMD, or browser globals. See // https://github.com/umdjs/umd, the returnExports.js (function (root, factory) { if (typeof define === 'function' && define.amd) { define(['lodash'], factory); } else if (typeof exports === 'object') { module.exports = factor...
true
caa4dcfcfb4b19578d09125d9dbf557c26130c94
JavaScript
mohayonao/web-audio-mock-api
/test/AudioBuffer.js
UTF-8
1,207
2.828125
3
[ "MIT" ]
permissive
"use strict"; const assert = require("assert"); const AudioBuffer = require("../src/AudioBuffer"); describe("AudioBuffer", () => { describe("constructor()", () => { it("create an AudioBuffer", () => { let buffer = new AudioBuffer(2, 1024, 44100); assert(buffer instanceof AudioBuffer); assert(...
true
df4a386b1a3996e807ae50145a81e6f6c85b08ba
JavaScript
dougrich/conscripter
/state/reducers/clearable.js
UTF-8
592
2.625
3
[ "MIT" ]
permissive
import { CLEAR } from '../actionTypes' const defaultOptions = { only: null } export default function clearable (defaultState, options = defaultOptions) { return reducer => { return (state = defaultState, action) => { if (action && action.type === CLEAR) { if (options.only) { const next...
true
db821a54443a4130595e06657f35004150c876fd
JavaScript
daijonbereola/cyber-security
/rsa.js
UTF-8
574
2.734375
3
[]
no_license
const { generateKeyPairSync } = require('crypto') const keyEncoding = { type: 'pkcs1', format: 'pem' } const generationParameters = { modulusLength: 1024, publicExponent: 3, publicKeyEncoding: keyEncoding, privateKeyEncoding: keyEncoding } const alice = generateKeyPairSync('rsa', generationParameters) c...
true
45feeccfebf2c859e07b352434fa5f109fc7c503
JavaScript
fermenting/prohibitor
/bition/src/components/game.component.js
UTF-8
2,912
2.578125
3
[]
no_license
import React, {Component} from 'react'; export default class Game extends Component { constructor(props) { super(props); this.onChangeTodoDescription = this.onChangeTodoDescription.bind(this); this.onChangeTodoResponsible = this.onChangeTodoResponsible.bind(this); this.onChangeTodoPriority = t...
true
a67bb1e9224461a771241fec3e14c17057afadac
JavaScript
reusabledata/reusabledata
/scripts/yamls2json.js
UTF-8
1,949
2.90625
3
[ "BSD-3-Clause" ]
permissive
//// //// Convert a set of source YAML files to the compiled single JSON data file. //// //// Example usage (amigo/master): //// node ./scripts/yamls2json.js -i ./data-sources/ -o ./data-sources/compiled.json //// var us = require('underscore'); var fs = require("fs"); var yaml = require('yamljs'); var path = require...
true
f5f87aa6368e8991d11af646af2ae7da88b18680
JavaScript
flodavis/common-components
/pure-javascript/clicked-based-event-listener.js
UTF-8
626
3.171875
3
[]
no_license
var body = document.querySelector('body'), clickTarget = document.getElementById('click-target'), mouseOverTarget = document.getElementById('mouse-over-target'), toggle = false; function makeBackgroundOrange () { 'use strict'; if (toggle) { body.style.backgroundColor = 'white'; } el...
true
c68f2e3599124d822a01a3757bef2ae2e27085cf
JavaScript
Tara78/Advanced-JS-React-Inlamning1
/src/App.js
UTF-8
2,411
3.203125
3
[]
no_license
import './App.css'; import React, { Component } from 'react'; import Dice from './components/dice'; class App extends Component { style={ fontStyle:'bold', color: 'blue', margin:'1.5rem', } constructor() { super(); this.state = { diceValue: [1, 2, 3, 4, 5, 6], } this.getFirstDice = ...
true
4ea5737d231204ffd8306fc3de9b5939dd2b184c
JavaScript
jondejong/swami11
/client/src/swami/components/message/message.store.jsx
UTF-8
643
2.59375
3
[]
no_license
import { SET_MESSAGE, CLEAR_MESSAGE } from './message.actions' const initialState = { message: '', type: '', visible: false } function messageStore(state = initialState, action) { let newState = {...state} switch (action.type) { case SET_MESSAGE: newState = { ...state, message: ac...
true
8e969a3b91360fe6cf62b8c4900d0b7734f45809
JavaScript
eea/volto
/src/reducers/comments/comments.js
UTF-8
2,133
2.703125
3
[ "MIT" ]
permissive
/** * Comments reducer. * @module reducers/comments/comments */ import { ADD_COMMENT, DELETE_COMMENT, UPDATE_COMMENT, LIST_COMMENTS, } from '@plone/volto/constants/ActionTypes'; const initialState = { add: { loaded: false, loading: false, error: null, }, delete: { loaded: false, l...
true
12dd1852a51339aa23259b61606ee5ca54671d8d
JavaScript
RB-Codes/amman-301d9
/class-13/warmup/react-app/src/App.js
UTF-8
638
3.015625
3
[]
no_license
import React, { Component } from 'react'; import './App.css'; class App extends Component { constructor(props) { super(props); this.state = { name: "Susan Sample", age: 27, pets: ["Fido", "Mr Whiskers"] }; } hadBirthday = () => { this.setState({age: this.state.age+1}); }; ...
true
ae5f07fecf31f837996919f1beb17fc8b92c919c
JavaScript
Rodina3/TWschool
/workspace/oop-dojo-master/spec/practice_7/main_spec.js
UTF-8
758
2.671875
3
[]
no_license
"use strict"; import {Person, Student, Teacher} from '../../main/practice_7' describe("OO入门", function () { it("对象之间的交互-1", function () { const p = new Person('Tom', 21); const s = new Student('Tom', 21, 2); const t1 = new Teacher('Tom', 21, 2); const t2 = new Teacher('Tom', 21); ...
true
72d7fb70b69b597b75ac8d9ace06b4e40d984530
JavaScript
Francis-Tao-jinjin/ipfs-hash
/start.js
UTF-8
391
2.546875
3
[]
no_license
const ipfsHash = require('./build/ipfsHash'); console.log(ipfsHash('Hello world')); console.log(ipfsHash('b')); const data = new Uint8Array(128); for (let i = 0; i < data.length; i++) { data[i] = i; } console.log(ipfsHash(data)); console.log(ipfsHash({ name: 'Bob', age: 25, data: data, })); console.log...
true
7d131e6c0c56378a8dc047c148d4c456df3f873e
JavaScript
wpfalive/xiaobei-utils
/src/plugins/cans/index.js
UTF-8
1,636
2.734375
3
[]
no_license
import Cansf from './cansf' import './letter-spacing' class Cans extends Cansf{ constructor (canvas) { super(canvas) this.render = async (config) => { this.setCanvas(config) await this.resolveImages(config.images) await this.resolveTexts(config.texts) await this.resolveLines(config.lin...
true
dc9e6160ad3833f3fb1379b4db3428e168a2f371
JavaScript
goitiarodrigo/Mytinerary-app
/redux/reducers/citiesReducer.js
UTF-8
906
2.71875
3
[]
no_license
const citiesReducer = (state = {allCities: [], cityFiltered: [], city: {}}, action) => { switch (action.type) { case "GET_ALL_CITIES": return { ...state, allCities : action.payload, cityFiltered: action.payload } case "GET_CITY...
true
2a8a796334cf945d0f2ac9109283a47aa196e32d
JavaScript
stycho/dataStructureModule
/lib/linkedList.js
UTF-8
1,772
3.25
3
[]
no_license
class LinkedList { constructor() { this._head = null; this._tail = null; this._count = 0; } get length() { return this._count; } // Returns an array of all data get allData() { let currentNode = this._head; let data = []; while (currentNode != null) { data.push(currentNod...
true
07d54dada68967347581244ae44415149245f98f
JavaScript
judas-christ/jarvis2000
/source/js/modules/listen.js
UTF-8
1,524
2.71875
3
[ "MIT" ]
permissive
(function(jarvis) { 'use strict'; var recognition; var slice = Array.prototype.slice, map = Array.prototype.map, filter = Array.prototype.filter; /** * Gets the best result from a SpeechRecognitionResultList * @param {[type]} results [description] * @return {[type]} [description] ...
true
4f28624ea5a8d4efe8821d48d624466e2eab117a
JavaScript
vant3x/practica-crud-react-redux
/src/Components/NuevoProducto.js
UTF-8
2,651
2.78125
3
[]
no_license
import React, { useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; // Actions de redux import { crearNuevoProductoAction } from './../actions/productoActions'; const NuevoProducto = ({history}) => { // state del componente const [nombre, guardarNombre] = useState(''); const [preci...
true
fbd8bf62f68d1ff3b1e04bab62f1974efb823ed0
JavaScript
lucasvmiguel/graphql-client-test
/src/SalesmenList.js
UTF-8
950
2.671875
3
[]
no_license
import React from 'react'; import gql from 'graphql-tag'; import { graphql } from 'react-apollo'; // The data prop, which is provided by the wrapper below contains, // a `loading` key while the query is in flight and posts when it is ready const SalesmenList = ({ data: {loading, salesmen} }) => { if (loading) { ...
true
eb1d3a57cb5c547261520e7d10877e3e8c3a58ac
JavaScript
tomasgodoi/cangjie-code
/lib/decompose.js
UTF-8
1,624
2.78125
3
[]
no_license
var cangjie = require('./cangjie'); var fs = require('fs'); var parse = require('csv-parse'); function buildMapping() { return new Promise((resolve) => { var rs = fs.createReadStream(__dirname + '/cangjie5.txt'); var parser = parse({delimiter: '\t'}, function(err, data) { resolve(data); }); rs....
true
54f797f37b690a651defdbc4133948c76aa99bc8
JavaScript
Petrdis/imgproxy
/processor.js
UTF-8
1,318
2.515625
3
[]
no_license
const sharp = require('sharp') const config = require('./config') module.exports = async ({ path, width, height, quality, crop }) => { if (!width || !path) { return null } const imagePath = `${config.basePath}${path}` const image = sharp(imagePath) let metadata = await image.metadata() ...
true
222bc86e75847480d7ccde39e1f71febd10daf22
JavaScript
sugbhatt/server-side
/server.js
UTF-8
533
2.5625
3
[]
no_license
const http = require('http'); const express = require('express'); const app = express(); const path = require('path'); const bodyparser = require('body-parser'); const server = http.createServer(app); /* app.get('/',(req,res) => { res.send('hello'); }) */ app.use(express.static(path.join(__dirname,'public'))); app...
true
80cd4a423787aba7a8d0aff14818d87613943954
JavaScript
RabeyaEty01/exploring-function-objects
/break-continue.js
UTF-8
639
3.28125
3
[]
no_license
// var i = 0; // while (i < 15) { // console.log(i); // if(i==5){ // break; // } // i++; // } // for(var i=0;i<20;i++){ // console.log(i); // if(i>8){ // break; // } // } var numbers = [54, 66, 35, 78, 90, 102, 45, 667]; // for (var i = 0; i < numbers.length; i++) { // ...
true
d5e3a9fcf432249b07b85ba6c41c95a0eff4951d
JavaScript
comp717web/api-test
/script.js
UTF-8
903
3.96875
4
[]
no_license
// Rick and Morty API: https://rickandmortyapi.com/ // Testing an API // Function that fetches our characters based on the name from the input field function fetchCharacters() { const inputValue = document.getElementById('character-input').value; // using Fetch to get the api characters fetch(`https://r...
true
b4a35384713ab39d3a2278ff935388fe595d157e
JavaScript
wuxinkai/node2
/自己写的node教程/7.上传功能/上传图片/form.js
UTF-8
2,060
2.59375
3
[]
no_license
var querystring = require('querystring'); //查询字符串 var fs = require('fs'); var http = require('http'); var url = require('url'); //第三方模块解析图片格式 var formidable = require('formidable'); var util = require('util'); var mime = require('mime'); http.createServer(function (req, res) { //一定会返回一个对象 true的话query也是一个对象 否则就是一个字...
true
29467a123f606d7d7c1367fefbeb2fe26c1a249f
JavaScript
green-fox-academy/adam-kovacs
/week-07/day-02/nyt/nyt.js
UTF-8
1,104
2.65625
3
[]
no_license
'use strict' let responseData = []; let httpRequest = new XMLHttpRequest; let table = document.querySelector('#main-table'); httpRequest.onload = () => { if (httpRequest.readyState === 4 && httpRequest.status === 200) { responseData = JSON.parse(httpRequest.responseText).response.docs; responseData.forEach(...
true
1c5e27026bbda5782886abf089d29c921c81cade
JavaScript
GovindJS/ShoppingApp
/frontend/js/home.js
UTF-8
3,202
2.515625
3
[]
no_license
let header = $("header") let cards = $(".cards") let myproducts = $("#myproducts") let mycart = $("#mycart") let logout = $("#logout") let addproduct = $("#addproduct") $( ()=>{ addHeader(); populatePdts(); myproducts.click((event)=>{ event.preventDefault(); getPdtsu...
true
3fe531f59f6bb389cfb876b49c4f8b17f96700e4
JavaScript
Chrisclone/ProjectNotes
/src/form.js
UTF-8
1,534
3.578125
4
[ "MIT" ]
permissive
// Adds new data to local storage const submit = document.getElementById("submitter"); submit.addEventListener("click", () => { let text = document.getElementById("text"); textStore(valueCreator(),text.value); logger(valueCreator(),text.value); text.value = ""; }) //creates/updates a "log" list o...
true
ccda2de82cd4401544d226c85fbfc09ed8a148b6
JavaScript
starlone/star.gameengine
/src/se/renderers/circlerenderer.js
UTF-8
841
2.828125
3
[ "Apache-2.0" ]
permissive
/* CircleRenderer */ se.CircleRenderer = function (radius, fillStyle, strokeStyle, lineWidth) { se.Renderer.call(this); this.radius = radius; this.fillStyle = fillStyle; this.strokeStyle = strokeStyle; this.lineWidth = lineWidth || 1; }; se.inherit(se.Renderer, se.CircleRenderer); se.CircleRenderer.protot...
true
fbd8855cb8a45261b71fdec9bba1cc3d1c10eadb
JavaScript
bannmoore/js-bank-ocr
/src/file-manager.js
UTF-8
698
3.15625
3
[]
no_license
/* * FileManager * Uses node 'fs' to read / write files */ function FileManager(filePath, fs) { this.filePath = filePath; this.fs = fs; } FileManager.prototype.read = function () { return new Promise((fulfill, reject) => { this.fs.readFile(this.filePath, (err, data) => { if (err) ...
true
43ed47ad493746f763c42d8715d033fb72d44c14
JavaScript
XavierCHN/Hexagen
/content/dota_addons/hexagen/panorama/scripts/custom_game/hexagen_example_hud.js
UTF-8
7,785
2.546875
3
[ "MIT" ]
permissive
"use strict"; var Length = {"A": 3, "B": 2, "C" : 2, "D" : 3, "E" : 2, "F" : 2, "PW": 32}; var ToggleNodeMode = false; var ToggleHexMode = false; var WaitingForHexClick = false; var WaitingForNodeClick = false; var TileList; var PATHING_STATE_FIRST_HEX = 1; var PATHING_STATE_FIRST_NODE = 2; var PATHING_STATE_SECOND_...
true
dc08a167b64c9c91bdc3debf178a6079d9f5dc6c
JavaScript
pcnicklaus/recast_ai_play
/bot_two.js
UTF-8
2,192
2.84375
3
[]
no_license
// load environment variables var dotenv = require('dotenv'); dotenv.config(); // recast and botkit dependencies const RecastBot = require('recastbot'); const Botkit = require('./node_modules/botkit/lib/Botkit.js'); // create the recast bot const ai = new RecastBot(process.env.RECAST_TOKEN); // create the controller...
true
9fdaf904a940fd48951808cf3895dfd1cb33b13b
JavaScript
renatognunes/fullstack-application
/client/src/components/CreateCourse.js
UTF-8
5,049
2.71875
3
[]
no_license
import React, { Component } from "react"; import Form from "./Form"; /** * CreateCourse component will display form and Submit course to API request. * @namespace CreateCourse * @extends React Component */ export default class CreateCourse extends Component { /** * State that stores the input from course's cr...
true
18641158d6f18d5cb28d132145c35ed21e920ff9
JavaScript
Soumyaranjan1996/Class-Activity
/activity/command/organize.js
UTF-8
1,977
2.921875
3
[]
no_license
function organizeFn(dirPath){ let destPath; if(dirPath == undefined){ console.log("Kindly enter the path"); return; } else{ let doesExist = fs.existsSync(dirPath); if(doesExist){ destPath = path.join(dirPath,"organized_files"); if(fs.existsSyn...
true
197f13c96997e672f5dda199839d555b6566ddbe
JavaScript
nobowling/Map-places-frontend
/src/js/addToFavorites.js
UTF-8
745
2.796875
3
[]
no_license
function addToFavorites() { const editId = event.target.getAttribute('class') const editMarkerObject = { name: document.getElementById('editPlaceName').value, description: document.getElementById('editPlaceDescription').value, latitude: document.getElementById('editPlaceLat').value, ...
true
728f872b084dfa49721c27f188e70e258dde0199
JavaScript
dmitry-ermakov/TestCon2021_PlayWright
/tests/testCase2.spec.js
UTF-8
409
2.515625
3
[]
no_license
const { test, expect } = require('@playwright/test'); test('check search results for "Test" value', async ({ page }) => { await page.goto('https://duckduckgo.com/'); await page.fill('#search_form_input_homepage', "Test"); await page.click('#search_button_homepage'); const firstResultText = await page.textConte...
true
66f47aa98a3a07dafc6179761480d68005595e83
JavaScript
NicholasBraga/trabalho_algoritmos_em_rotas
/main.js
UTF-8
1,112
2.90625
3
[]
no_license
var http = require('http'); var url = require('url'); // Importando o conteudo do arquivo "funcoes" var funcoes = require("./funcoes") var server = http.createServer(function (request, response) { response.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' }); var parametro = url.parse(request.u...
true
be1e436964fe4e35556451d66863a085537cc5c9
JavaScript
ctiller15/YDKJS
/this&objectprototypes/Chapter_3/Ex_12.js
UTF-8
291
4.21875
4
[]
no_license
// If you try to add a property to an array, but the property name // "looks" like a number, it will end up as a numeric index and modify the array contents. var myArray = [ "foo", 42, "bar" ]; myArray["3"] = "baz"; console.log(myArray.length); // 4 console.log(myArray[3]); // "baz"
true
3a391040cdf112666e6a67234fe45e3158939804
JavaScript
ForthTek/PictoHunt
/Components/API/Server.test.js
UTF-8
785
2.78125
3
[]
no_license
import Server from "./Server.js"; describe("server tests", () => { var server; // Create connection to the server beforeAll(async () => { server = new Server(); }); describe("1.0 filter tests", () => { test("1.1 containsSwear", async () => { const test = "shit"; expect(await server.cont...
true
8347259fb9999d3f097b7bb90e99774875612368
JavaScript
CloudlessSoul/chunktionary
/public/javascripts/populate-search-input.js
UTF-8
241
2.546875
3
[]
no_license
/** * Script to reflect the search query in the URL in the search bar. */ const urlParams = new URLSearchParams(window.location.search); const searchTerm = urlParams.get('query'); document.getElementById("search-input").value = searchTerm;
true
67dd4b3335d18266bba577d80b9bfb37217728b5
JavaScript
Su-Avi-Craw-Hern-Ste/adlister
/src/main/webapp/resources/js/editAd.js
UTF-8
1,166
3.09375
3
[]
no_license
"use strict"; if ($("#rarity").val() === $("#common").val()) { $("#common").prop("checked", true); } if ($("#rarity").val() === $("#uncommon").val()) { $("#uncommon").prop("checked", true); } if ($("#rarity").val() === $("#rare").val()) { $("#rare").prop("checked", true); } if ($("#rarity").val() === $(...
true
240e7645283af61f5865618d46b3e580021a7a6b
JavaScript
JoyPalumbo/github.io
/studies/operators.js
UTF-8
4,252
4.34375
4
[]
no_license
/*** * Operators: Operators are used to assign or compare values. They are also used to perform arithmatic. * * 1.The symbols used for operators are +,-, *, / =, %, ++, --. * 2. There are 6 main operator types: assignment, arithmetic, comparison, logical, unary and ternary. * A. Assignment operators are u...
true
cd83423d483d401e14640ce7dbffb2eb20534654
JavaScript
synzen/discord-invites
/client/build/index.js
UTF-8
2,411
3.5625
4
[ "MIT" ]
permissive
async function getUser () { // Fetch from the API const identity = await (await fetch('/api/users/@me')).json() // Populate the user info document.getElementById('userId').innerText = identity.id document.getElementById('username').innerText = identity.username await getInvites() } async function getI...
true
e0e6c8d571920c1dd35f98e1e2730165a69e87fb
JavaScript
accraze/doYrWork
/routes/index.js
UTF-8
1,505
2.703125
3
[]
no_license
/* * GET home page. */ exports.index = function(Todo) { return function(req, res) { Todo.find({}, function(error, todos) { res.render('index', { title: 'Do YR Work', todos : todos }); }); }; }; exports.addTodo = function(Todo) { return function(req, res) { var todo = n...
true
05f98c974248766519562b3de5a731a720b15a29
JavaScript
dkp67853/ResumeBuilder
/ResumeBuilder/script.js
UTF-8
3,644
3.21875
3
[]
no_license
function addAQ(){ let newNode = document.createElement("textarea"); newNode.classList.add("form-control"); newNode.classList.add("aqField"); newNode.classList.add("mt-2"); newNode.setAttribute("placeholder", "Enter Here"); let aqOb = document.getElementById("aq"); let aqAddButtonOb ...
true
49911cf1fd147ee4a690d9568ae3740c1c4ea6c9
JavaScript
ysdn2018/the-next-grid
/src/App.js
UTF-8
1,398
2.546875
3
[]
no_license
import React, { Component } from 'react'; import './App.css'; import styled, { keyframes } from 'styled-components' const Container = styled.div` width: 100vh; height: 100vh; overflow: hidden; ` const gridAnimV = keyframes` from { transform: translateX(0); } to { transform: translateX(-103vw); } `; co...
true
68247ea10f20628f7f5705c6a0997487bfe448a9
JavaScript
aguin467/MovieApp
/client/src/Ids.js
UTF-8
837
2.546875
3
[ "ISC", "MIT" ]
permissive
import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import './Ids.scss'; const fetch = require('node-fetch'); class Id extends Component { constructor(props) { super(props); this.state = { Id: [] }; } componentDidMount() { this.getId(); } ...
true
f075c90ad81e7f9d2bbd3945f404ed2173953235
JavaScript
adamzhoul/dockercli
/fe/static/terminal.js
UTF-8
2,187
2.546875
3
[]
no_license
// var url = "ws://" + document.location.host + "/api/v1/log/ns/mservice/pod/96143-helloworld-mservice-8644cb8dd7-sfkx4/container/application" var url = "ws://" + document.location.host + "/api/v1/log/ns/mservice/pod/128330-aosnotice-mservice-56844b8c58-k7blk/container/application" if (document.location.pathname !== "/...
true
8ed2e26ef1001932ef9633c0700980450aea5d77
JavaScript
diegolorenzomolinero/pcloud-sdk-js
/src/api/__mocks__/ApiMethod.js
UTF-8
2,231
2.875
3
[ "MIT" ]
permissive
/* @flow */ /** * Mock for api/method * * Exports the actual mock (apiMethod) as default and: * on(match: (method, options) => boolean, respond: (method, params) => data, onFire?: () => void) * one: same as on, but handler is removed upon first usage * * helpers that enhance response for use in the respond fu...
true
e4b0c66a50ff5539c8a845b82a96ef51b0e8e1ee
JavaScript
JStatik/react-auto-insurance
/src/helpers/isValidQuotationForm.js
UTF-8
1,199
2.53125
3
[]
no_license
import validator from 'validator'; const isValidQuotationForm = ( mark, model, plan ) => { if( mark.trim().length < 4 || model.trim().length < 4 || plan.trim().length < 5 ) { return { msgErrorQuotation: 'Todos los campos son necesarios para la cotización.', isValid: false };...
true
b5957bc98f671d93083956ccf3a463a826777f8f
JavaScript
mikemaliniak/NodeJS-Prac-Snippets
/50.js
UTF-8
682
2.984375
3
[]
no_license
// Files and fs // ============= var fs = require('fs'); // Synchronous load var greet = fs.readFileSync(__dirname + '/greet.txt', 'utf8'); console.log(greet); console.log(__dirname); // Most cases you don't need it to be Synchronous' var greet2 = fs.readFile(__dirname + '/greet2.txt', 'utf8', function(err, data){...
true
40b2ef1e121d0c354347040e3688410c0b61b80a
JavaScript
Elena7676/bjs-2-homeworks
/8.decorators/task.js
UTF-8
1,353
3.328125
3
[]
no_license
function cachingDecoratorNew(func) { let cache = []; function wrapper(...args) { const hash = args.join(","); let idx = cache.findIndex((item) => item.hash === hash); if (idx !== -1) { console.log("Из кэша: " + cache[idx].value); return "Из кэша: " + cache[idx].value; } else { le...
true
fc9c261182fcd575c96d6a84784598ccdc421e9d
JavaScript
jlagr/react-gifexpertapp
/src/components/AddCategory.js
UTF-8
783
2.625
3
[]
no_license
import React, {useState} from 'react' import PropTypes from 'prop-types'; const AddCategory = ({ setCategories }) => { const [inputText, setInputText] = useState('') const handleInputTextChange = (e) => { setInputText(e.target.value) } const handleSubmit = (e) => { e.preventDefau...
true
b9e1562ecddf1148f8683457541f6127ae74e0af
JavaScript
beejhuff/MTG-Card-Collector
/type_search.js
UTF-8
1,863
3.078125
3
[]
no_license
const scry = require("scryfall-sdk"), mongoose = require("mongoose") const Card = require("./models/Card") mongoose.connect("mongodb://localhost/mtg_card_collector") // The following function returns a Promise. It can be called in other files by requiring it and then calling: /* findCards(searchTerms, exactM...
true
f4c911c8575651f88c6cd0773082c702d7e32288
JavaScript
radomirKrastev/Algorithms
/JS/Combinatorial_Greedy/Combinatorial/permutationsNoReps.js
UTF-8
608
3.8125
4
[]
no_license
const input = ['A', 'B', 'C']; const source = input.map(x => x = { c: x, marked: false }); const permute = (output, source, index) => { if (index >= source.length) { console.log(output.join(' ')); return; } for (let i = 0; i < source.length; i++) { if (source[...
true
0645b2f3340efa4bba3438dda62a5dea17e8f903
JavaScript
ThatPham2000/ProjectCK_QuanTri
/18120545_18120561_18120568/controllers/product.Controller.js
UTF-8
1,049
2.546875
3
[]
no_license
const productServices = require('../models/productServices'); module.exports.index = async (req, res, next) => { // Get books from model const products = await productServices.listAllProduct(); // Pass data to view to display list of books res.render('products', {title: 'Products', subtitle: 'List prod...
true
a36db8892855cd9403b8ac846f573fcd7fc53b1e
JavaScript
silverdiva/cs313-php
/web/scripts/scripts.js
UTF-8
515
2.921875
3
[ "MIT" ]
permissive
function onPageLoad() { $("#pOne").fadeIn(5000); $("#pTwo").delay(1000).fadeIn(5000); $("#pThree").delay(2000).fadeIn(5000); } $(document).ready(onPageLoad); // ta02.js function clickMe() { alert("Clicked!"); } function changeColor() { var textbox_id = "txtColor"; var textbox = document.getElementById(textbox...
true
ee2f3860b9212cfe2427aaa251644cfc8992525e
JavaScript
kwlskiy/kwlskisnipz
/learning/number.js
UTF-8
58
2.625
3
[]
no_license
const result = Math.round(3.3 / 1.1); console.log(result)
true
089cc5c0ab048f5c4edc50428eb5af85d255f85e
JavaScript
thunder033/rtm-data-syncing-iii
/src/ng/network/user-factory.js
UTF-8
1,045
2.65625
3
[ "BSD-2-Clause" ]
permissive
/** * Maintains state of the user's connection to the server * @author Greg Rozmarynowycz <greg@thunderlab.net> */ 'use strict'; const IOEvent = require('event-types').IOEvent; const EntityType = require('entity-types').EntityType; module.exports = {userFactory, resolve: ADT => [ ADT.network.NetworkEntity, ...
true
9ea6ccd380bb6da9ae8740410aa96f7a239827d6
JavaScript
callchenxi/wordGame
/miniprogram/utils/getExamWid.js
UTF-8
719
2.6875
3
[]
no_license
import words from '../data/words.js'; import getRandomInt from './getRandomInt.js' export default function getExamWid() { let learned = wx.getStorageSync('learned') || null; if(learned == null) { wx.showToast({ title: '目前无可复习的单词', duration: 700, icon: 'none', mask: true }) return...
true
b53a8adb47372c5fef594c2cab07eeab51116fcf
JavaScript
JustinBarnard1/swapi
/app/Controllers/PlanetsController.js
UTF-8
591
2.609375
3
[]
no_license
import { ProxyState } from "../AppState.js"; import { planetsService } from "../Services/PlanetsService.js"; function _drawPlanets() { let planets = ProxyState.planets let template = '' planets.forEach(p => template += p.Template) document.getElementById("planets").innerHTML = template } export defaul...
true
b78bff9188546f9920f398cd61b778859c9c1f4d
JavaScript
jvalero77/prac2
/script.js
UTF-8
1,526
3.078125
3
[]
no_license
var boton = document.getElementById("formBuscar"); boton.addEventListener("submit",function(event){ event.preventDefault(); fetch(`https://www.theaudiodb.com/api/v1/json/1/search.php?s=${document.getElementById("inputBuscar").value}`, { headers: { Accept: 'application/json' }, method: 'GE...
true
e718b5e599034cad83887c929447b61c320ed6b8
JavaScript
michealparks/codsworth
/app/fullscreen.js
UTF-8
497
2.53125
3
[ "MIT" ]
permissive
export const setFullscreenMode = (callback) => { const endFullscreen = () => { window.removeEventListener('keydown', endFullscreen) window.removeEventListener('mousedown', endFullscreen) window.removeEventListener('touchstart', endFullscreen) callback() } window.addEventListener('keydown', endFul...
true
7cf519a31776a35ec35e4587d2acbd704015037e
JavaScript
sagarsandy/react-complete-guide
/src/App.js
UTF-8
960
2.96875
3
[]
no_license
import React, { Component } from 'react'; import './App.css'; import Person from './Person/Person' class App extends Component { // State is a javascript object, so that we can use it in render part to render dynamic content. state = { person : [ {name : "SS Sagar", age : 22}, {name : "SS Sandy", ...
true
9d8110b5de2b0b8aa353fad5d36e25a64d91f76e
JavaScript
plaisteixo-5/Cursos
/DevQuarentena/LaçoRepetição/scripts.js
UTF-8
281
2.71875
3
[]
no_license
var quant = 0; function adicionarLike(){ if (quant == 0){ quant = 1+quant; botao.innerHTML = quant + " Like" // alert(quant+"Like") } else{ quant = 1+quant; botao.innerHTML = quant + " Likes" // alert(quant+"Likes") }; };
true
325b3c15ba7ea014caee03a63d36dd2fdb608024
JavaScript
jwaang/algoexpert
/medium/reverseWordsInString.js
UTF-8
940
4.28125
4
[]
no_license
// 7/6/21 // Time: O(n) | Space: O(n) function reverseWordsInString(string) { let stringArray = new Array(string.length).fill(""); for (let i = 0; i < string.length / 2; ++i) { swap(i, string.length - 1 - i, string, stringArray); } let idxOne = 0; for (let i = 0; i < string.length; ++i) { if (stringA...
true
bb6a2fa404df3d662b54dec127e9a895fb56eac4
JavaScript
alexrider94/algorithm_study
/baeckjoon/2193.js
UTF-8
1,369
4.09375
4
[]
no_license
/* 0과 1로만 이루어진 수를 이진수라 한다. 이러한 이진수 중 특별한 성질을 갖는 것들이 있는데, 이들을 이친수(pinary number)라 한다. 이친수는 다음의 성질을 만족한다. 이친수는 0으로 시작하지 않는다. 이친수에서는 1이 두 번 연속으로 나타나지 않는다. 즉, 11을 부분 문자열로 갖지 않는다. 예를 들면 1, 10, 100, 101, 1000, 1001 등이 이친수가 된다. 하지만 0010101이나 101101은 각각 1, 2번 규칙에 위배되므로 이친수가 아니다. N(1 ≤ N ≤ 90)이 주어졌을 때, N자리 이친수의 개수를 구하는 프로그램을 ...
true
8e2c85e7a0a0a5eb72cf424ba9efa2b6b42e479d
JavaScript
princejwesley/extractjs
/extractjs.js
UTF-8
4,098
2.625
3
[ "MIT" ]
permissive
/*!The MIT License (MIT) Copyright (c) 2015 Prince John Wesley (princejohnwesley@gmail.com) **/ ;(function(root, factory) { 'use strict'; if (typeof define === 'function' && define.amd) { define(['exports'], factory); } else if (typeof exports !== 'undefined') { module.exports = factory(); } else { ...
true
61f1f7b904b6890eee0011eb03585608b4b50015
JavaScript
santanaG/JS-Chip-8
/js/main.js
UTF-8
5,623
2.578125
3
[]
no_license
/******************************************************************************* * initial setup *******************************************************************************/ var c8 = chip8(); var ctx; var control = { tickRate : 256, intervalId: 0 }; /***********************************************************...
true
f1ed9d9165f28c3beabf590a4ef1b96f4809a2a6
JavaScript
stijnb1234/themepark-api
/index.js
UTF-8
8,485
2.53125
3
[]
no_license
let reset = "\x1b[0m"; let yellow = "\x1b[33m"; let red = "\x1b[31m"; const mysql = require("mysql"); const tools = require("./functions/tools"); var login = function (options) { let host = options && options.host; let user = options && options.username; let password = options && options.password; ...
true
ed0871b387ac72e2b88e3de28adb03ed1270efd2
JavaScript
ghardin1314/Crypto-Arcade
/client/src/components/ReacteroidsClient/ParticleClient.js
UTF-8
623
2.71875
3
[ "MIT" ]
permissive
export default class ParticleClient { constructor(args) { this.position = args.position this.velocity = args.velocity this.radius = args.radius; this.lifeSpan = args.lifeSpan; this.inertia = args.inertia; } render(state){ // Draw const context = state.context; context.save(); ...
true
390daee60cd8f9eb61105bf2194e9a3b54d3fd65
JavaScript
swena56/PWR
/PWR/public/js/Calculator.js
UTF-8
8,085
2.828125
3
[ "MIT" ]
permissive
class Calculator extends React.Component { constructor(props) { super(props); this.state = { input: '', loading: false, solved: false, error: false, shaking: false, }; this.focus = this.focus.bind(this); th...
true
775398bfcc77e7384a1eefeee6e9560ddaf8a66b
JavaScript
honggzb/Study2016
/ES6Study/MYES6/app/js/class/lesson7.js
UTF-8
1,359
4.125
4
[]
no_license
/* * 函数新增特征 */ { function test(x,y='world') { //参数默认值, 注:默认值后面不能没有默认值的变量,如test(x,y='world',c)错误,test(x,y='world',c='123')错误 console.log('默认值',x,y); } test('hello'); //默认值 hello world test('hello','kill'); //默认值 hello kill } { let x="test"; function test2(x,y=x) { console.log('作...
true
631c1c10d4e8193ff87c872a37a127a1bd667757
JavaScript
ultimate-coders/hexagon
/src/auth/controllers/resetPasswordControllers.js
UTF-8
3,675
2.765625
3
[ "MIT" ]
permissive
'use strict'; const { updateUserPassword, randomGenerator, getUserByEmail, } = require('../models/user'); const { validatePassword } = require('./helpers'); const sendEmail = require('../../utils/mailer'); const usersPasswordVerification = {}; // {userId: {exp; '342343232', code: '6654654sdfds64'}, ...} const ...
true
e7f9ef7a917fe308f4a431bae1929d7371dc3ffb
JavaScript
SergeyShapkarin/basic-js
/src/carbon-dating.js
UTF-8
504
2.640625
3
[ "MIT" ]
permissive
const CustomError = require("../extensions/custom-error"); const MODERN_ACTIVITY = 15; const HALF_LIFE_PERIOD = 5730; module.exports = function dateSample(sampleActivity) { try { if (sampleActivity && typeof sampleActivity == 'string') { numericValue = parseFloat(sampleActivity); if (numericValue > ...
true
84275fbe1b4a4c0b7c8072bdf79815791b26cb30
JavaScript
s-shin/limechat-hipchat-ss-theme
/HipChat-ss.js
UTF-8
335
3.078125
3
[]
no_license
// クエリに日本語を含むURLをデコードして見やすくする。 document.addEventListener("DOMNodeInserted", function(e) { var line = e.target; var urls = line.getElementsByClassName("url"); for (var i = 0; i < urls.length; ++i) { var url = urls[i]; url.textContent = decodeURIComponent(url.href); } });
true
a72ce1ec3c7e3b32bc88572ecc5d30529fa1f3ac
JavaScript
jazztbone2b/reactnd-project-myreads
/src/Book.js
UTF-8
1,895
2.53125
3
[]
no_license
import React, { Component } from 'react'; class Book extends Component { state = { bookShelf: null } componentDidMount() { this.updateShelf(this.props.book.shelf); } updateShelf = (shelfName) => { this.setState(() => ({ bookShelf: shelfName ...
true
6987c4e22a91b086ed8f8f38841ad4e75b827fa5
JavaScript
Atramp/cmccmarket
/WebRoot/adf/common/locals/teradata-lang-zh_CN.js
UTF-8
2,410
2.65625
3
[]
no_license
if (Teradata.widget.TextField) { Teradata.apply(Teradata.widget.TextField.prototype, { minLengthText : "该输入项的最小长度是 {0} 个字符", maxLengthText : "该输入项的最大长度是 {0} 个字符", requiredText : "该输入项必需填写", regexText : "正则表达式校验错误", emptyText : null }); } if (Teradata.widget.EmailField) { Teradata.apply(Teradata...
true
b07f10c705f81c071aa2c5e6dd29916f5ee79e88
JavaScript
velossien/learnyounode
/LYN3.js
UTF-8
203
3.078125
3
[]
no_license
var fs = require('fs'); var buf= fs.readFileSync(process.argv[2]); var output = buf.toString(); var newLines= output.split("\n"); var numberOfNewLines= newLines.length-1; console.log(numberOfNewLines);
true
b5de8d16bce8c9527814bad4442a5777958f6e73
JavaScript
pariford/expensify-app
/src/tests/actions/add.test.js
UTF-8
535
3.671875
4
[]
no_license
const add = (a, b) => a + b; const generateGreeting = (name = "Anonymous") => `Hello ${name}!`; test("should add two numbers", () => { const result = add(3, 4); if (result != 7) { throw new Error("Add is not working properly."); } }); test("Name should be populated", () => { const result = generateGreeting(...
true
f253eae9e22d526877ab96e499dd3c2ce8e4f2f3
JavaScript
ahazel17/tidewave
/commands/moderation/ban.js
UTF-8
1,375
2.75
3
[]
no_license
const Discord = require("discord.js") module.exports = { name: 'ban', aliases: ['desterrar', 'expatriar','b'], description: 'destierra del server al wachin seleccionado', run: async (client, message, args) => { const channel = client.channels.cache.get('675585949983440897') if (!message....
true
54a38c313421214b569be7729b0ae68299b54a58
JavaScript
Hangyuge/Flask-app
/ihome/static/js/ihome/newhouse.js
UTF-8
6,986
2.671875
3
[]
no_license
new Vue({ el: "#v-container", data: { // 存储区域的对象列表 area_obj_arr: [], // 房屋信息的参数 title: '', price: '', area_id: '', address: '', room_count: '', acreage: '', unit: '', capacity: '', beds: '', deposit: '', ...
true
f7d77fb34992e6f03bbadf4711ad04036170d27b
JavaScript
ktiktok96/weather-report
/scripts/index.js
UTF-8
2,513
3.90625
4
[]
no_license
// Variables that are representing Elements let btnAdd = document.getElementById('add'); let btnSubtract = document.getElementById('subtract'); let tempInput = document.getElementById('temp_id'); let landscape = document.getElementById('landscape'); let skiesInput = document.getElementById('sky-select'); let skiesLands...
true
090338e13082a6a840d1a2879d28bfb439a0926d
JavaScript
coding4rever/HNG-Task-2-Team-Falcon
/scripts/HNG-05138.js
UTF-8
280
2.96875
3
[]
no_license
const Hng_task2 = () => { let fullName = "Ifeanyi Muogbo"; let id = "HNG-05138"; let language = "Javascript"; let email = "ifytechspace@gmail.com"; return `Hello World, this is ${fullName} with HNGi7 ID ${id} using ${language} for stage 2 task. ${email}`; }; console.log(Hng_task2());
true
a7d9db98bccdb129edf842fcd321d4b08445217d
JavaScript
kaushalyekishor/MyFirstJavaScript
/ChallengePrograms/Day1/Basic.js
UTF-8
373
4.3125
4
[]
no_license
//String concatenation let a = '1' + 2 ; let b = 2 + '1'; let c = 2 + 1; console.log(a , b, c); // 12 21 3 //Comma let s = (1 + 2, 3 + 4); console.log(s); // 7 (the result of 3 + 4) //User input and Concatenation const prompt = require('prompt-sync')(); let num1 = prompt("First Number: "); //2 let num2 = prompt("Se...
true
3c51a71c25832863b3471084a0e5ab02f71e8b67
JavaScript
jyoko/kue-workers
/makejobs.js
UTF-8
1,022
2.984375
3
[]
no_license
/* makejobs.js * * Example for how to setup a short test, * no automated setup in place as of now. * * Can be used as follows: * * node makejobs.js [number_of_jobs] * * Will create N jobs with a finish date randomly chosen * in the future, with a title of 'Test job: #' and some * dummy data */ var kue = r...
true
2f693ec55ea09344b06549d6f6fb5ea4a2b742d4
JavaScript
Lyrisbee/leetcode
/Algorithms/Hard/4-Median-of-Two-Sorted-Arrays.js
UTF-8
1,193
3.609375
4
[]
no_license
/** * @param {number[]} nums1 * @param {number[]} nums2 * @return {number} */ var findMedianSortedArrays = function(nums1, nums2) { const len1 = nums1.length, len2 = nums2.length; let target = []; if (len1 === 0 || len2 === 0) { target = len1 === 0 ? nums2 : nums1; } if (target...
true
b45ea290ba7480e882c3d9437fc3e19c01f67a0d
JavaScript
tbain17/decorator-js-homework
/decorator.js
UTF-8
1,272
3.046875
3
[]
no_license
const Decorator = function () { this.paintStock = []; }; Decorator.prototype.addPaint = function (paintcan) { this.paintStock.push(paintcan) }; Decorator.prototype.totalPaint = function () { let totalPaint = 0; for(let paint of this.paintStock) { totalPaint += paint.total; }; return totalPaint; }; De...
true
663e58d4d4c079149f53fc46299b37dcc0dcf247
JavaScript
emresiimseek/my-netflix
/src/js/main.js
UTF-8
889
2.6875
3
[]
no_license
import { refreshButton, movies } from './dom-loader.js'; import { getMovies } from './provider'; import "../../assets/index.css"; import img from '../img/netflix_logo.svg'; refreshButton.addEventListener("click", createTemplate); createTemplate(); async function createTemplate() { let currentCard = ""; const ...
true
497932f1dcf6fd90be339faeede77b2af2e51527
JavaScript
wintersleepmachine/monsters-rolodex
/src/App.js
UTF-8
1,838
3.40625
3
[]
no_license
import React, {Component} from 'react'; import {CardList} from './components/card-list/card-list.component' import {SearchBox} from './components/search-box/search-box.component' import './App.css'; class App extends Component { constructor(){ //constructor runs first super() this.state = { monsters: [], ...
true
840fb7cd5cb898bee8b8a1edfe8147c7a6e797e5
JavaScript
nextbitlabs/ternary-plot
/src/labels.js
UTF-8
1,029
2.6875
3
[ "MIT" ]
permissive
import {svg} from 'hybrids'; import {getAngleFromTicksPositions} from './utils'; export function renderLabels(labels) { return labels.map(d => svg` <text x="${d.x}" y="${d.y}" dy=3 >${d.text}</text> `); } export const bottomLabels = { get: ({bottomTicksPositions, tickLenght}) => getLabels(bottomTick...
true