�����    �   huggingface�{"info": {"features": {"id": {"dtype": "string", "_type": "Value"}, "text": {"dtype": "string", "_type": "Value"}, "dataset_id": {"dtype": "string", "_type": "Value"}}}}p4���� dataset_id��������text���� id����  �^,   �� ���,�,�`<�+x�+x�+� ,�Y���#)08@FMU]els{����������������� &-5=ELS[bipw~����������������� !(08?FMT\ckry����������������� ")19AIPX_gov}����������������� ")08@HPW^fmt|�����������������%-4<BIOW_fnv~����������������� $+3;BJRZbipw�����������������'-4<CJRYahmu|�����������������$,3;CKS[bjrz������������������   # * 2 9 A I Q Y a h p x  � � � � � � � � � � � � � � � � �    " ) 1 9 @ H O W _ g n v } � � � � � � � � � � � � � � � � �    ' . 5 < D K R Y a i q x � � � � � � � � � � � � � � � � � �    ! ) 1 9 A I P W ^ e l s { � � � � � � � � � � � � � � � � �    ' . 6 > F N U \ d k r z � � � � � � � � � � � � � � � � � �  #*2:BJRY`hpw�����������������  '.5<DKS[bjrz������������������ ")18@HOU]dlsy����������������� !'.5=ELTZ`gnv}�����������������"*29?FMU]dkpw����������������� "*29AIPW_gov}�����������������  '.5;BJRX_fnu|�����������������  '/6=EMU]emu|����������������� ")19AIPX`fmt|�����������������$,3:AHPW^fnu}����������������� #+29AHOW^emu|�����������������  '.6>FMT[cjry������������������ "*29AIPX_gnv}����������������%,4;CJRYahpx�����������������  '/6<CJQYaipw����������������487301321476122718926673266118451089234205514160168198921014022618712054846851172600210278223162514492403024615101017448456437355779277731141400856642194673271873462796937434782738146632941510369338453581144301319010413157147691758292391487021750641515575508668939713406424107883858152749517095561025610393834112715971913790880410464337353146127657901884505142812520294710267490774013435516243231313445604136089401498207312670282789383261764191434704442453319503037572980016940223811714799292362973513916504518833619911943048845511928324340685588858900100392691838692737410524117900357674735535481688821655316231123219957957267534556301073158781622038991121215557009341892505111291598401440760544579469757156289191191064314990041115149191011511445291883658315973018330933142945481281634018302179326226013665441382151911855207166560891298068652855751891170923669211266772014340675878372962447551573564865126197533586029191769359017239518100459081739591615115208694794416049767188335861807633539884191203855237112182380479177622336254069135796108692655137914819648234251065218607868123749871452753711809568649192717932561850915646361004597506130489369217586390948214846605165359211711476721728341402722590768470082761829831682359546197387160177763068495785663516923188152861322416776444153555378881164329896842071039707140829433983425105250643986062394900383593195289041267722271309621523729310067709192035138287096166326311508063285325383875680727006814579697141239097745643344333412091763172381482616843711830917807634177304121357714218644687770060815698096117983183763319456986912748592106108167607574119487931675608513155858138431831352680276214536522111267637718913727598289610085376333160618773510150684615153394329245410496301682067831209221943648611044502933742010018990107807842537679135859461368792610345057131015201242227965275882170031421900263282851404517175998521587590179692732168258716081069989543958121457976718959548447980318911377276721912190910342535710947300109998383388811100900811790470111868914249680714592390227955013860268177201531603588972575966802320121875781079935114389261884725810117123154601401811852211849586337099516253041151135451001613325555032807899394995144742351651531344108419638301863876271332445006606200285116149201711625112852754138826881183448718547369927639729003884956630505395913535965168426651358419136734324779268135554431340920418616786173662301197041360676191514323116145739247104118262212151437495560589415049310882217125427114123194681337122255316698088288417614186846791914515659347103710985181168175626221333767861188262064292147776582655365384227164657131193080040803211684603798647441412116611850320137595233632294187016401613030175904844462235378808414205498112841563278338132742811302884618867685168209298593930168263416073487497777213065071606503687163468121813970799652802130760921042942318018536395379624014648646821564022044542672768669232090513075683131620761226495464218201680223579670297096923170436501376101115528285521945012834226743956927697885372068106838407959826163410818426754430400166060928018518932041993226613207672796221115988604160041941683339610646404100997191252954192477337106251428132060543947591832568277019108638155315171768236710533200116749378820502114368259773520112049548224038262334218489788186245322022521189150337369014769511788511423097931200024012603840177601131358105445200796344371824323612328482176693651894887526989513631358125223158619248138164916196889115665085350941476903240487691395408719385516377133984402228791002496051412405135426698115287808183737918337516318872964600371511221014849729316635102676615127809255113098982921015345414371315115554341274593414392905448291428548101720973912153759861796610360252191539161561742498853767744939498366371298231005789040543547907989247287405398463370051583452111779323407329692366295375592192564021058791517567919932493958031501098288241859771882263175231158296392334628120699801025781488387041688402210518104136808069100726430251053828510726036522097159219121118852515916517279026464195761407754717444145117643323287009126455819792231018357134939853271834774262155428881936425190733338178520170704753867875105066291793634154493018591311481000537640771222629411238311324881638681164988531744304510457661624631917246578836729913177666157449031296644137991501149787190610731147129114393716187551321287548016341601151961838461282963804279020733482995571630109920812093169163724008187250193584229756772449797107944461221713886625138355493041863169796169755227093199141233101845236013575002182563201799103017551571617033949279816086287114958205720763166308681066739213318155125999911595763774509024638618893945110918434849728950120192307221038141052630116323423309876493862804025096459731038724013057633806394655698018781960169613208669407133123781035936586021893459269148598498654189551284412928776740874719256195318065366189229847074145999011715527566870261185070619044138656477413434747195232854898489314032814827311173293111359116837998832271594679804917065721617003219004061153269163585241925721314277233171242624955253721867386424451031419718090707311749627272181761475034936891364796383505110063661210850172169401564802266161821826695832121757228018842404383616554099514263331334094660419314843026110301482641171433365775432099382157129528641294724815905781127092182202211898927618607211968521823991961131999188575418477839115100558860977665180317407921135490681801686179369477821746488975513486211124211311493446917621489142127861483052110436308673350752465701103614711775878125995981030522323932112999717238103114767701173311771655304113823959194043417020152112894424906986467986755671431733192312817111833060913253282419906162287271272336816457296114598249568571149171341207591931683031640621936755160358992190047117317849245580538330111657871278637910592947470331952775261402475610872474586755786684113271562847461114092040358634586678691284256115931881910491686350378099851661635641089801599295346872554702841557018749189374023079163819441102440865751921580348114953408147863781565947212398759158660937363684302075814518618194556447599898153047278057201127933501353581474606722541575637796379575621077384643192101597099023690581916861716487952349105105124284601763398351010937862737776993134401642051515613298135662214928574119070091795579114840442116978013993512553138343988501085234419221470101568945187693922559182456482493615593895410381794146542052940757538251837152672296639724630074861541457343211563546153795276536213968469518747371099891924487951531738339230013829218594503366293502424734885201911249914999045850075626273084413735514408101184287091429950173329371885998193898645169651435502945810281941860152813251272728914830612185701931286579798144561546257418215516371063810420799991351917169138774893511283739977412313078749142225758193229136227471719896313683050113845821324782215220772112644034717437103656761457571294039325076600142681688770695689773711603410714727937159471795040835094931081361895786411495226983349261505697885198131406163628227201830378914783007791971618875501346536632737733451008115134121636500110754141434396116434165647865820159912259028182477901412524829499373919099346404613266134305925382743766743049625070698945013156904737900640163983814506247230912985612398967165278491890974878003628752953144794143447261127053143436369811132615400390384550517162500148381861459752318209830108569082750608137046001680414115147001158296123286361355689316798477S� � ���^�gxi�n}s~j�>���C� :  "��&�(�3�4.I|MzVa�zۂ��H� �P�P�?��\�����������5��� ���f�����"K%E&�':*�,�0�=�B�Ck"�4�49�;jPwSN[�]ڀ�$�����m�޴���������%�����X��{;�2:9�;?A�B F�F�HuKkLd\�^)l�w�~E�v����������&������w���"M4(�m���_���+�����Hg�w������ �������� o � ��� Z;�>_�ŧ��ީ1�˫e�$�4�b�z������2�a#�&�&,e0�6"<na�q�sz�I����ƑU�������L���N�����$����n�� y + � � �Z �\ �] P_ �a fq �q �w Py �{ #� W� �� 5� �� �� ܞ � 3� i� � e� H� J� �� I� �� �� �� � _ O. 9/ �0 = M? �B �s vt �x �| �~ �� � � �� [� B� �� �� �� �� l� �� � ; �  �! �, �6 h8 �D �J T �T �a �b Tc #d ƌ ֎ �� �� � �� �� ;� » y� � �� �� z� � �  �% �6 �: �h (l ˟ � � � �� � �� J� � K� �� � s � � ~ �! *" h) �, �- > B �E 6U �Y �[ !a �a F� � �� �� �� T� ��m " L FKLGSjZc_΋��#�߷&���&��������_���� � x\�;��� :*m-Y@�A�Ps`Xaqn�p�w1x�z�|���!�5 ?�@N�g�i���+��������V�(���s��������}���U����MoO�Y�a> �x(i*�+=/0�H�H�LAPUZ�\�gkhB�J���L���ա����|2:�;�JkKtW�X$m�p *Iz�*�C!pX�T�X�\�]i_ g�l�ov3vdv�w�x�|X~r�Ȏ��Ԥ������n�G�������������}���n��_ S��,J-�4�4�8�?�lPs'x:�u�އ�_��}�c��������P��p���d�������� � � �$*f049=,M>S�_�`+jOknTr��� �~�� ��'g(p)�)�.�7�?�@qH I}I�R\S�}��:�t�Y�M�^�����2�(�x36~H�LSPX*l�o0�*��#�����������s��^2���) ^%�4KeMNOr������J�S��e����� Q�'f-'.E2�24�7�CqL�RnU�VW](a�a�c�d��s�p�5�ݛN�R���+�4�x� V kRdT<W1[[�vxJ���C���������I�����V��� �V � V~�$N&�/_���1�c�6����>15�JLLm\�^�e}�������ׇ�����l�Ҫ��ү-�g���S���S��� ��"_*��=�,�̣ҷC�����������)�  H  X { D+ ;: �< �E �T 4^ �x O� �� /� Ș � D� �� � _� �� � �� � � f� �� �� ��!l�! �!��!��!��!��!�"0"� "H"�"�""U3"F4"�="RB"+R"�W"Y"]"�o"�r"qv"y"�{"-�"�"��"$�"��"�"r�"i�"̞"��"��"�"N�"خ"��"Ǿ"(�"��"�"_�"��"��"C�"^#�!#�"#�##f.#�4#�:#c>#A#�#.�#��#��#�#:�#�#$�#{�# �#��#T$�$3$Q$D$�$J$$�$$�($q,$96$D$�D$�E$�L$�Q$�Q$�U$0^$\_$%b$m$�o$b~$�$"�$��$,�$6�$֛$��$��$��$|�$��$��$��$1�$��$)%L%�% %�%r %�"%�)%-%8%d9%�<%�=%�B%OG%�d%-e%�g%�p%�{%J�%N�%��%#�%s�%s�%E�%_�%}�%��%��%'�%{�%/�%��%�%m&}&!&�$&�&&�'&(&�+&�/&�u&��& �&'�&Д&��&9�&�&ǯ&̰&��&��&�&��&��&#�&��&�'�' ';'�'�*'^-'�7'28'�['�['�^'E�'��'�'[�'Z�'M�' �'��'7�'d�'��'�'7�'q�'G(k(`(~ ( '( ((I6(�:(K=(�B(מ(S�(I�(3�(��(ѷ()�)�)})��*��*V�*��*��*E�*��*��*��*�1+�9+\;+�K+8Q+�T+/n+�{+4|+�~+G+j�+)�+��+ϊ+�+��+�+�+describe('weaponRollDatabase.js', function() { const fateBus = require('fateBus.js'); const brunchModule = {id:'test'+this.result.description}; const rollDatabase = require('weaponRollDatabase.js').weaponRollDB; const Utility = require('weaponRollAssessment.js').Utility; beforeEach(function() { // The module receiving the publication is the parent class fateBus.unmute('itemDatabase.js'); fateBus.registerModule(brunchModule); fateBus.publish(brunchModule, 'fate.weaponRollDataFetched', '6917529047963087340\tPositive Outlook\tY\tN\tReload masterwork + Kill Clip = so good!'); }); describe('in response to fate.weaponRollDataFetched', function() { describe('#contains', function() { describe('when the roll is in the database', function() { it('should be true', function() { expect(rollDatabase.contains('6917529047963087340')).toBe(true); }); }); }); describe('#get', function() { describe('when the roll is found', function() { it('should return the roll', function() { const roll = require('weaponRollAssessment.js'); const po = rollDatabase.get('6917529047963087340'); expect(po).toEqual(jasmine.any(roll.WeaponRollAssessment)); expect(po.rollID).toEqual('6917529047963087340'); expect(po.name).toEqual('Positive Outlook'); expect(po.pveUtility).toEqual(Utility.YES); expect(po.pvpUtility).toEqual(Utility.NO); expect(po.comments).toEqual('Reload masterwork + Kill Clip = so good!'); }); }); }); }); }); const unique = require("./unique"); // words const adjectives = require("../data/adjectives"); const continuation = require("../data/continuation"); const final = require("../data/final"); const nounsPlural = require("../data/nouns.plural"); const nounsSingular = require("../data/nouns.singular"); const verbsImperative = require("../data/verbs.imperative"); const verbsPast = require("../data/verbs.past"); const verbsPresent = require("../data/verbs.present"); /** * format a string * @param format {string} The string format * @example: format('{a} {v} {n}') * @return {string} 'adjective verb singularNoun' phrase */ module.exports = function format(format) { // until each item is replaced // we don't want to do a /g global in one swoop because we need to run // unique test on the string as it builds while (/\{[a-zA-Z]\}/.test(format)) { format = format .replace(/{a}/, () => unique(format, adjectives)) .replace(/{c}/, () => unique(format, continuation)) .replace(/{i}/, () => unique(format, verbsImperative)) .replace(/{V}/, () => unique(format, verbsPresent)) .replace(/{v}/, () => unique(format, verbsPast)) .replace(/{N}/, () => unique(format, nounsPlural)) .replace(/{n}/, () => unique(format, nounsSingular)) .replace(/{f}/, () => unique(format, final)); } return format; }; module.exports.HTTPS_PROTOCOL = `https://`; module.exports.OKTA_SSWS_TOKEN = process.env.OKTA_SSWS_TOKEN; module.exports.OKTA_BASE_URL = `${module.exports.HTTPS_PROTOCOL}${process.env.OKTA_BASE_URL}`; module.exports.API_VERSION = `api/v1`; module.exports.GROUP_ID_DEFAULT = `abc124`; module.exports.OKTA_ACCOUNT_STATUS = { ACTIVE: 'ACTIVE', PROVISIONED: 'PROVISIONED', // 'Pending user action' DEPROVISIONED: 'DEPROVISIONED', // 'Pending user action', 'Deactivated' PASSWORD_EXPIRED: '' }; import React from 'react'; import ReactDOM from 'react-dom'; import { BrowserRouter } from 'react-router-dom'; import App from './App'; import 'semantic-ui-less/semantic.less'; import 'slick-carousel/slick/slick.css'; import 'slick-carousel/slick/slick-theme.css'; import 'react-quill/dist/quill.snow.css'; import './index.less'; import { DragDropContextProvider } from 'react-dnd'; import HTML5Backend from 'react-dnd-html5-backend'; import * as serviceWorker from './serviceWorker'; import AppUxManager from './uxManager/AppUxManager'; console.log('HTML5Backend ===> ', HTML5Backend); const REACT_APP_IS_UX_MANAGER = process.env.REACT_APP_IS_UX_MANAGER; ReactDOM.render( REACT_APP_IS_UX_MANAGER ? ( ) : ( ), document.getElementById('root'), ); // If you want your app to work offline and load faster, you can change // unregister() to register() below. Note this comes with some pitfalls. // Learn more about service workers: https://bit.ly/CRA-PWA serviceWorker.unregister(); 1000+ import { LitElement, html, css } from 'lit-element'; import { t } from '../directives/i18n'; export default class PagesByCategories extends LitElement { static cName = 'pages-by-categories'; static properties = { items: { type: Object }, type: { type: String }, categories: { type: Array } }; constructor() { super(); this.items = null; this.type = 'page'; this.categories = null; } render() { const categories = this.categories || Object.keys(this.items); return html` `; } } PagesByCategories.styles = css` :host { display: block; } ul { list-style-type: none; margin: 0; padding: 0; } nav > h3:first-child { margin-top: 0; } li { margin-top: 8px; } `; frontend/src/app/AppLayout.js import React from "react"; import PropTypes from "prop-types"; import classNames from "classnames"; import { withStyles } from "@material-ui/core/styles"; import CssBaseline from "@material-ui/core/CssBaseline"; import AppBar from "@material-ui/core/AppBar"; import Toolbar from "@material-ui/core/Toolbar"; import Typography from "@material-ui/core/Typography"; import Websocket from "react-websocket"; import IdleTimer from "react-idle-timer"; import { compose } from "redux"; import { connect } from "react-redux"; import { Button } from "@material-ui/core"; import { Link, withRouter } from "react-router-dom"; import * as localStorage from "../utils/localStorage"; import AccountCircle from "@material-ui/icons/AccountCircle"; import ActiveNotificationIcon from "@material-ui/icons/NotificationsActive"; // import ArrowDropDown from '@material-ui/icons/ArrowDropDown'; import MenuItem from "@material-ui/core/MenuItem"; import Menu from "@material-ui/core/Menu"; import IconButton from "@material-ui/core/IconButton"; import NotificationsIcon from "@material-ui/icons/Notifications"; import Badge from "@material-ui/core/Badge"; import { fetchSignInRefreshToken, initiateSignOut, fetchChannels, fetchElections, fetchCategories, fetchInstitutions, fetchProvinces, fetchDistricts, fetchDivisionalSecretariats, fetchGramaNiladharis, fetchPollingDivisions, fetchPollingStations, fetchPoliceStations, fetchPoliceDivisions, fetchWards, getCannedResponses, changeLanguage } from "../shared/state/sharedActions"; import { loadUsers } from "../user/state/userActions"; import { showModal, hideModal } from "../modals/state/modal.actions"; import RootModal from "../modals/components/RootModal"; import Breadcrumbs from "./Breadcrumbs"; import { API_BASE_URL } from "../config"; import { userCan, USER_ACTIONS } from "../user/userUtils"; import * as notificationsAPI from "../api/notifications"; import { WEB_SOCKET_BASE_URL } from "../config"; const HomeLink = (props) => ; const ReportLink = (props) => ; const ReviewComplaintsLink = (props) => ; const StaticReportLink = (props) => ; const ArchiveLink = (props) => ; const drawerWidth = 240; const styles = (theme) => ({ root: { // display: 'flex', flexGrow: 1, }, homeButton: { marginLeft: theme.spacing.unit * 4, }, appBar: { transition: theme.transitions.create(["margin", "width"], { easing: theme.transitions.easing.sharp, duration: theme.transitions.duration.leavingScreen, }), }, appBarShift: { width: `calc(100% - ${drawerWidth}px)`, marginLeft: drawerWidth, transition: theme.transitions.create(["margin", "width"], { easing: theme.transitions.easing.easeOut, duration: theme.transitions.duration.enteringScreen, }), }, menuButton: { marginLeft: 12, marginRight: 20, }, hide: { display: "none", }, drawer: { width: drawerWidth, flexShrink: 0, }, drawerPaper: { width: drawerWidth, }, drawerHeader: { display: "flex", alignItems: "center", padding: "0 8px", ...theme.mixins.toolbar, justifyContent: "flex-end", }, reviewMenu: { li: { paddingTop: 8, paddingBottom: 8, }, boxShadow: "none", }, content: { flexGrow: 1, paddingTop: theme.spacing.unit * 3, paddingLeft: theme.spacing.unit * 8, paddingRight: theme.spacing.unit * 8, transition: theme.transitions.create("margin", { easing: theme.transitions.easing.sharp, duration: theme.transitions.duration.leavingScreen, }), marginTop: theme.spacing.unit * 1, }, contentShift: { transition: theme.transitions.create("margin", { easing: theme.transitions.easing.easeOut, duration: theme.transitions.duration.enteringScreen, }), marginLeft: 0, }, grow: { flexGrow: 1, }, breadCrumbWrapper: { marginBottom: theme.spacing.unit * 4, }, }); class DomainContainer extends React.Component { constructor(props){ super(props) this.state = { open: true, anchorEl: null, anchorLang: null, menuAnchorEl: null, authToken: null, anchorNotification: null, notifications: [], unreadNotificationCount: 0, timeout: 1000 * 60 * 15, isTimedOut: false, }; this.idleTimer = null this.onAction = this._onAction.bind(this) this.onActive = this._onActive.bind(this) this.onIdle = this._onIdle.bind(this) } /** * user idle actions */ _onAction(e) { // console.log("user did something", e); this.setState({ isTimedOut: false }); } _onActive(e) { // console.log("user is active", e); this.setState({ isTimedOut: false }); } _onIdle(e) { // console.log("user is idle", e); const isTimedOut = this.state.isTimedOut; if (isTimedOut) { this.props.hideIdleTimeOutModal(); this.handleSignOut(); } else { this.props.showIdleTimeOutModal() this.idleTimer.reset(); this.setState({ isTimedOut: true }); } } refreshTokenScheduler = (signInData) => { if(!this.state.isTimedOut && signInData){ this.props.refreshToken() } } componentDidMount() { this.props.getChannels(); this.props.getElections(); this.props.getCategories(); this.props.getInstitutions(); this.props.getProvinces(); this.props.getDistricts(); this.props.getDivisionalSecretariats(); this.props.getGramaNiladharis(); this.props.getPollingDivisions(); this.props.getPollingStations(); this.props.getPoliceStations(); this.props.getPoliceDivisions(); this.props.getWards(); this.props.loadAllUsers(); this.props.loadCannedResponses(); const signInData = localStorage.read("RequestManagementUser"); signInData && this.setState({ authToken: signInData.token }); this.loadNotifications(); // following is only neccessary when you have to periodically get new tokens this.interval = setInterval(() => this.refreshTokenScheduler(signInData), 1000 * 60 * 15); } loadNotifications = async () => { const notificationResponse = await notificationsAPI.getNotifications(); let unread = 0; let notifs = notificationResponse.data; for (let i = 0; i < notifs.length; i++) { if (!notifs[i].is_read) { unread++; } } this.setState({ notifications: notifs, unreadNotificationCount: unread }); }; handleDrawerOpen = () => { this.setState({ open: true }); }; handleDrawerClose = () => { this.setState({ open: false }); }; handleLangMenu = (event) => { this.setState({ anchorLang: event.currentTarget }); }; handleLangMenuClose = () => { this.setState({ anchorLang: null }); }; handleMenu = (event) => { this.setState({ anchorEl: event.currentTarget }); }; handleMenuClose = () => { this.setState({ anchorEl: null }); }; handleNotificationList = (event) => { this.setState({ anchorNotification: event.currentTarget }); }; handleNotificationListClose = () => { this.setState({ anchorNotification: null }); }; handleSignOut = () => { const { signOut } = this.props; signOut(); }; handleLanguageChange = (lang) => { const { changeLanguage } = this.props; changeLanguage(lang); }; handlePasswordChange = () => { window.open(API_BASE_URL + "/admin/password_change/", "_blank"); }; handleOnClickReviewMenuOpenButton = (e) => { this.setState({ menuAnchorEl: e.currentTarget }); }; handleReviewMenuClose = () => { this.setState({ menuAnchorEl: null }); }; handleOnClickReviewMenuItem = (e) => { this.setState({ menuAnchorEl: null }); }; handleSokcetData(data) { let result = JSON.parse(data); let notificationUpdate = this.state.notifications.slice(); notificationUpdate.unshift(result.payload); this.setState({ notifications: notificationUpdate, unreadNotificationCount: this.state.unreadNotificationCount + 1, }); } getNotifiactionText(notification) { if (notification.custom_messsage) { return notification.custom_messsage; } else { switch (notification.notification_type) { case "INCIDENT_ASSIGNED": return "Issue Assigned"; case "INCIDENT_CLOSED": return "Issue Closed"; default: return "notification"; } } } handleNotificationClick(notification) { if (!notification.is_read) { this.setState({ unreadNotificationCount: this.state.unreadNotificationCount - 1, }); this.handleNotificationListClose(); try { notificationsAPI.markAsRead(notification.id); } catch (e) { console.log(e); } } window.location = `/app/review/${notification.incident}`; } render() { const { classes, selectedLanguage, signedInUser, location } = this.props; const { open, anchorEl, anchorLang, anchorNotification, authToken, notifications, } = this.state; const menuOpen = Boolean(anchorEl); const langMenuOpen = Boolean(anchorLang); const notificationsOpen = Boolean(anchorNotification); const selectedMainSection = location.pathname.split("/")[2]; return (
{ this.idleTimer = ref }} element={document} onActive={this.onActive} onIdle={this.onIdle} onAction={this.onAction} debounce={250} timeout={this.state.timeout} /> {authToken && ( )} Tell The President {userCan( signedInUser, null, USER_ACTIONS.CAN_REVIEW_INCIDENTS ) && ( // // )} {userCan(signedInUser, null, USER_ACTIONS.CAN_VIEW_REPORTS) && ( )} {userCan( signedInUser, null, USER_ACTIONS.CAN_REVIEW_INCIDENTS ) && ( )} {/* */} {notifications.map((notification, index) => { return ( this.handleNotificationClick(notification)} > {this.getNotifiactionText(notification)} {!notification.is_read && ( )} ); })}
Profile Change Password Sign Out
{this.props.children}
); } } DomainContainer.propTypes = { classes: PropTypes.object.isRequired, theme: PropTypes.object.isRequired, }; const mapStateToProps = (state, ownProps) => { return { isSignedIn: state.shared.signedInUser.isSignedIn, selectedLanguage: state.shared.selectedLanguage, signedInUser: state.shared.signedInUser.data, }; }; const mapDispatchToProps = (dispatch) => { return { signOut: () => { dispatch(initiateSignOut()); }, changeLanguage: (lang) => { dispatch(changeLanguage(lang)); }, showError: (error) => { dispatch({ type: "SHOW_NOTIFICATION", error: { message: "Major error in data! Fallback", }, }); }, getChannels: () => { dispatch(fetchChannels()); }, getElections: () => { dispatch(fetchElections()); }, getCategories: () => { dispatch(fetchCategories()); }, getInstitutions: () => { dispatch(fetchInstitutions()); }, getProvinces: () => { dispatch(fetchProvinces()); }, getDistricts: () => { dispatch(fetchDistricts()); }, getDivisionalSecretariats: () => { dispatch(fetchDivisionalSecretariats()); }, getGramaNiladharis: () => { dispatch(fetchGramaNiladharis()); }, getPollingDivisions: () => { dispatch(fetchPollingDivisions()); }, getPollingStations: () => { dispatch(fetchPollingStations()); }, getPoliceStations: () => { dispatch(fetchPoliceStations()); }, getPoliceDivisions: () => { dispatch(fetchPoliceDivisions()); }, getWards: () => { dispatch(fetchWards()); }, loadAllUsers: () => { dispatch(loadUsers()); }, loadCannedResponses: () => { dispatch(getCannedResponses()); }, showIdleTimeOutModal: () => { dispatch(showModal('IDLE_TIME_OUT_MODAL')) }, hideIdleTimeOutModal: () => { dispatch(hideModal()) }, refreshToken: () => { dispatch(fetchSignInRefreshToken()) } }; }; export default withRouter( compose( withStyles(styles, { withTheme: true }), connect( mapStateToProps, mapDispatchToProps ) )(DomainContainer) ); swiing/parser /** * (c)2021 - swiing * parser@1.0.0 * A minimalist, generic-purpose parser for simple user-defined languages. */ /** * A language spec, that can be extended */ // @minify: for production, I could get rid of this, and provide the full // language at once, without splitting into pieces (extensions). // If I want to build a minified language, I should set the environment // variable to true. // For a minified language, words a single characters (except for those words // which are used as keys outside of the language itself). That means I can get // rid of spaces (in alternates and phrases), and of "|" (in alternates). const minifiedlang = process.env.minifiedlang || false; class Language { /** * @param {Object} spec in the form * { terminals, phrases, alternates, semantics } */ constructor( spec ) { this.extend( spec ); } /** * @param {Object} spec in the form * { terminals, phrases, alternates, semantics } * @return this */ extend( spec ) { let me = this, key, separator = " | "; // avoid duplicates // see https://medium.com/dailyjs/how-to-remove-array-duplicates-in-es6-5daa8789641c function unique( string ) { return [...new Set( string.split( separator ) )].join ( separator ) } // alternates come on top of the existing alternates for( key in spec.alternates ) if( me.alternates && me.alternates[ key ] ) // alternates are separated by "|", but in case of minified language // there is no separator at all between altenates (which are single // characters). spec.alternates[ key ] = unique( me.alternates[ key ] + separator + spec.alternates[ key ] ); if( minifiedlang ) { // remove any space in phrases for( key in spec.phrases ) spec.phrases[ key ] = spec.phrases[ key ].replace( /\s+/g, "" ); // remove any space and | in alternates for( key in spec.alternates ) spec.alternates[ key ] = spec.alternates[ key ].replace( /\s+|\|/g, "" ); } // merge the extension into this for( key in spec ) me[key] = Object.assign( me[key] || {}, spec[key] ); // allow chaining extensions return me } } // eof util/language export default Language; var greetings = require('./User.js') // sayHelloInEnglish: function() { // return "HELLO"; // }, // sayHelloInSpanish: function() { return "Hola"; } console.log(greetings.sayHelloInEnglish()) console.log(greetings.sayHelloInSpanish()) const {test,password} = {test:"hello to test value",password: ""} console.log("test: " + test) console.log("password: " + password)fmoliveira/saudecampinas /* global angular */ 'use strict' /* Biblioteca do Angular */ require('angular') var _ = require('lodash') /* Carrega o app Angular */ angular.module('HackathonApp') /* Define o serviço para retornar a lista de especialidades médicas */ .factory('Especialidades', function ($http, Relatorios) { var service = {} /* Consulta a lista de especialidades */ service.listarEspecialidades = function () { return $http.get('/api/especialidades') } service.chartEspecialidades = function (regiao, especialidades) { var data = [] var labels = [] console.log(especialidades) var aRegEsp = Relatorios.atendimentosRegiaoEspecialidades(regiao.descricao, _.join(especialidades, ',')) return aRegEsp.then(function (n) { n.data.forEach(function (i) { labels.push(i._id.especialidade) data.push(i.qtdeAtendimentos) }) var dataChart = { labels: labels, datasets: [ { label: 'My First dataset', fillColor: 'rgba(220,220,220,0.2)', strokeColor: 'rgba(220,220,220,1)', pointColor: 'rgba(220,220,220,1)', pointStrokeColor: '#fff', pointHighlightFill: '#fff', pointHighlightStroke: 'rgba(220,220,220,1)', data: data } ] } return dataChart }) } return service }) const express = require("express"); const auth = require("../middleware/auth"); const {check} = require("express-validator"); const productController = require("../controllers/products"); const router = express.Router(); // Get all products router.get("/", auth, productController.getAllProducts); // Get a single user's products router.get("/:userId", auth, productController.getUserProducts); // Get a product by its ID router.get("/product/:productId", auth, productController.getProduct) router.put("/edit/:productId", [ auth, [ check("name", "Name is required").notEmpty(), check("description", "Description is required").notEmpty(), check("price", "Price is required").isNumeric() ] ], productController.editProduct); // Create Product router.post("/", [ auth, [ check("name", "Name is required").notEmpty(), check("description", "Description is required").notEmpty(), check("price", "Price is required").isNumeric() ] ], productController.createProduct); // Delete Product router.delete("/:productId", auth, productController.deleteProduct); module.exports = router;ui/src/history.js1000+ import { client } from './plugins/Platform.js' import { noop } from './utils/event.js' const getTrue = () => true function filterInvalidPath (path) { return typeof path === 'string' && path !== '' && path !== '/' && path !== '#/' } function normalizeExitPath (path) { path.startsWith('#') === true && (path = path.substr(1)) path.startsWith('/') === false && (path = '/' + path) path.endsWith('/') === true && (path = path.substr(0, path.length - 1)) return '#' + path } function getShouldExitFn (cfg) { if (cfg.backButtonExit === false) { return () => false } if (cfg.backButtonExit === '*') { return getTrue } // Add default root path const exitPaths = [ '#/' ] // Add custom exit paths Array.isArray(cfg.backButtonExit) === true && exitPaths.push( ...cfg.backButtonExit.filter(filterInvalidPath).map(normalizeExitPath) ) return () => exitPaths.includes(window.location.hash) } export default { __history: [], add: noop, remove: noop, install ({ $q }) { if (__QUASAR_SSR_SERVER__ || this.__installed === true) { return } const { cordova, capacitor } = client.is if (cordova !== true && capacitor !== true) { return } const qConf = $q.config[ cordova === true ? 'cordova' : 'capacitor' ] if (qConf !== void 0 && qConf.backButton === false) { return } // if the '@capacitor/app' plugin is not installed // then we got nothing to do if ( // if we're on Capacitor mode capacitor === true // and it's also not in Capacitor's main instance && (window.Capacitor === void 0 || window.Capacitor.Plugins.App === void 0) ) { return } this.add = entry => { if (entry.condition === void 0) { entry.condition = getTrue } this.__history.push(entry) } this.remove = entry => { const index = this.__history.indexOf(entry) if (index >= 0) { this.__history.splice(index, 1) } } const shouldExit = getShouldExitFn( Object.assign( { backButtonExit: true }, qConf ) ) const backHandler = () => { if (this.__history.length) { const entry = this.__history[ this.__history.length - 1 ] if (entry.condition() === true) { this.__history.pop() entry.handler() } } else if (shouldExit() === true) { navigator.app.exitApp() } else { window.history.back() } } if (cordova === true) { document.addEventListener('deviceready', () => { document.addEventListener('backbutton', backHandler, false) }) } else { window.Capacitor.Plugins.App.addListener('backButton', backHandler) } } } const process = require('process'); const spawn = require('child_process').spawn; const fs = require('fs'); const Util = { getCommand: function () { let cmd = "npm"; process.argv.forEach((command) => { if (command === '--yarn') { cmd = 'yarn'; } }); if (process.platform === "win32") { cmd += '.cmd'; } return cmd; }, getFiles: (dir) => { let files = {}; fs.readdirSync(dir).forEach(file => { files[file] = file; }); return files; }, isHtml: (filename) => { const splitted = filename.split('.'); return splitted[1] === 'html'; } } const Server = { process: null, files: [], start: function () { const cmd = Util.getCommand(); this.process = spawn(cmd, ['run', 'serve'], { stdio: 'inherit' }); console.log('WEBPACK STARTED'); }, restart: function () { console.log('WEBPACK RESTART'); this.process.kill(); this.start(); }, watch: function (dir) { this.files = Util.getFiles(dir); this.start(); fs.watch( dir, { recursive: true }, (eventType, filename) => { if (filename && eventType === 'rename') { if (Util.isHtml(filename)) { if (!this.files[filename]) { console.log('file created or deleted', filename); this.files = Util.getFiles(dir); this.restart(); } } } } ); } } Server.watch('./src/html'); frontend/react_app/src/index.js import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; import * as serviceWorker from './serviceWorker'; import { combineReducers, createStore, compose, applyMiddleware } from 'redux'; import { Provider } from 'react-redux'; import thunk from 'redux-thunk'; import authReducer from './store/authReducer'; const reducer = combineReducers({ auth: authReducer }); // Using Combine Reducers here although only one reducer is present. // Official explaination here: https://react-redux.js.org/using-react-redux/connect-mapstate#mapstatetoprops-will-not-run-if-the-store-state-is-the-same const composeEnhanced = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose // The first one is to make the chrome dev extension work const store = createStore(reducer, composeEnhanced(applyMiddleware(thunk))); // We are using thunk, because it allows delaying the dispatch actions // Thunk wraps the dispatch actions into custom functions which are available with the mapDispatchToProps ReactDOM.render( , document.getElementById('root') ); serviceWorker.unregister();import { defineAsyncComponent } from 'vue' /** * 组件里面注册控件用 * * 文本 * ** el-form-text 单行文本、电话、邮件、搜索 * ** el-form-area 多行文本 * ** el-form-password 密码 * ** el-form-url * * 数字 * ** el-form-number 数字 * ** el-form-range 滑块 * * 日期 * ** el-form-date 日期、年月、年周、年 * ** el-form-time 时间 * * 选择 * ** el-form-checkbox 勾选 * ** el-form-switch 开关 * ** el-form-checkboxs 多选组 * ** el-form-radios 单选组 * ** el-form-select 下拉选择 */ export const formItemList = { // 文本类 defineComponent 'el-form-text': defineAsyncComponent(() => import('./t-text.vue')), 'el-form-area': defineAsyncComponent(() => import('./t-area.vue')), 'el-form-url': defineAsyncComponent(() => import('./t-url.vue')), 'el-form-password': defineAsyncComponent(() => import('./t-password.vue')), 'el-form-autocomplete': defineAsyncComponent(() => import('./t-autocomplete.vue')), // 数字 'el-form-number': defineAsyncComponent(() => import('./n-number.vue')), 'el-form-range': defineAsyncComponent(() => import('./n-range.vue')), // 日期、时间 'el-form-date': defineAsyncComponent(() => import('./d-date.vue')), 'el-form-datetime': defineAsyncComponent(() => import('./d-datetime.vue')), 'el-form-year': defineAsyncComponent(() => import('./d-year.vue')), 'el-form-month': defineAsyncComponent(() => import('./d-month.vue')), 'el-form-week': defineAsyncComponent(() => import('./d-week.vue')), 'el-form-time-select': defineAsyncComponent(() => import('./d-time-select.vue')), 'el-form-time-picker': defineAsyncComponent(() => import('./d-time-picker.vue')), // 选择、开关 'el-form-checkbox': defineAsyncComponent(() => import('./s-checkbox.vue')), 'el-form-switch': defineAsyncComponent(() => import('./s-switch.vue')), 'el-form-checkboxs': defineAsyncComponent(() => import('./s-checkboxs.vue')), 'el-form-radios': defineAsyncComponent(() => import('./s-radios.vue')), 'el-form-select': defineAsyncComponent(() => import('./s-select.vue')), 'el-form-selwrite': defineAsyncComponent(() => import('./s-selwrite.vue')), 'el-form-select-cascader': defineAsyncComponent(() => import('./s-select-cascader.vue')) } /** * 动态组件的字典,便于v-for循环里面设置控件 */ export const formItemListKey = { // 文本类 100: formItemList['el-form-area'], // 多行文本 101: formItemList['el-form-text'], // 单行文本 102: formItemList['el-form-password'], // 密码 103: formItemList['el-form-text'], // 电话 104: formItemList['el-form-text'], // 邮件 105: formItemList['el-form-url'], // url 106: formItemList['el-form-text'], // 搜索 107: formItemList['el-form-autocomplete'], // 可填可选 // 数字 120: formItemList['el-form-number'], // 数字 121: formItemList['el-form-range'], // 滑块 // 日期、时间 110: formItemList['el-form-date'], // 日期 111: formItemList['el-form-datetime'], // 日期 + 时间 112: formItemList['el-form-month'], // 年月 113: formItemList['el-form-week'], // 年周 114: formItemList['el-form-year'], // 年 115: formItemList['el-form-time-picker'], // 任意时间 116: formItemList['el-form-time-select'], // 选择固定时间 // 选择、开关 150: formItemList['el-form-checkbox'], // 勾选 151: formItemList['el-form-switch'], // 开关 152: formItemList['el-form-checkboxs'], // 多选组 153: formItemList['el-form-radios'], // 单选组 160: formItemList['el-form-select'], // 下拉 161: formItemList['el-form-selwrite'], // 下拉多选 162: formItemList['el-form-select-cascader'] // 下拉联动 } 0 $(document).ready(function() { recordarray = []; dataresult = ""; window.speechSynthesis.onvoiceschanged = function() { loadVoices(); }; $("#chatbox").keypress(function(event) { if (event.which == 13) { event.preventDefault(); newEntry(); } }); $("#rec").click(function(event) { switchRecognition(); }); $("#event").click(function(event) { newEntry(); $.ajax({ type: "POST", url: baseUrl + "contexts?sessionId=241187", contentType: "application/json; charset=utf-8", dataType: "json", headers: { "Authorization": "Bearer " + accessToken }, data: JSON.stringify([{ name: 'medication-followup', lifespan: 5 }]), }); $.ajax({ type: "POST", url: baseUrl + "query?v=20170712", contentType: "application/json; charset=utf-8", dataType: "json", headers: { "Authorization": "Bearer " + accessToken }, data: JSON.stringify({ event: { name: 'prescription_event', data: { 'doctor': 'Dr SAM', disease: 'Cold', medicine: 'CROCIN COLD & FLUMAX TABLETS', days: '20' } }, timezone: 'America/New_York', lang: 'en', sessionId: '241187' }), success: function(data) { setResponse(JSON.stringify(data, undefined, 2)); setAudioResponse(data); }, error: function() { setResponse("Internal Server Error"); } }); }); $('#modalopen').click(function() { $('.input-field .dropdown-content').on('mousewheel DOMMouseScroll', function(e) { e.stopPropagation() }); $('.input-field .dropdown-content li').scroll(function(e) { e.stopPropagation(); }) if ($('#modal1').hasClass('slide-right')) { $('#modal1').addClass('slide-left', 1000, 'easeOutBounce'); $('#modal1').removeClass('slide-right'); } }); $(".grid-container .margin-top").click(function() { $('#modal1').removeClass('slide-left'); $('#modal1').addClass('slide-right', 1000, 'easeOutBounce'); }); //Socket io related code goes over here //var socket = io.connect('https://deloitte-hr-manager.herokuapp.com'); var socket = io.connect('http://localhost:5001'); socket.on('chartdata', function(data) { var chartdetail = JSON.parse(data); var length = chartdetail.length; var width = 600; var height = 300; var chartdetail; chartdetail.forEach(function(val, index, theArray) { CreateChart(val); status = true; }); function CreateChart(data) { var chartdatum = data; FusionCharts.setCurrentRenderer('javascript'); FusionCharts.ready(function() { var visitChart = new FusionCharts({ type: chartdatum.type, id: chartdatum.chartcontainer, renderer: 'javascript', renderAt: chartdatum.chartcontainer, width: '1400px', height: '700px', dataFormat: 'json', dataSource: { "chart": { "caption": chartdatum.caption, "subCaption": chartdatum.subCaption, "xAxisName": chartdatum.xAxisName, "yAxisName": chartdatum.yAxisName, "lineThickness": "2", "exportEnabled": '1', "paletteColors": "#009688", "baseFontColor": "#333333", "baseFont": "Helvetica Neue,Arial", "captionFontSize": "14", "subcaptionFontSize": "14", "subcaptionFontBold": "0", "showBorder": "0", "bgColor": "#ffffff", "showShadow": "0", "canvasBgColor": "#ffffff", "canvasBorderAlpha": "0", "divlineAlpha": "100", "divlineColor": "#999999", "divlineThickness": "1", "divLineIsDashed": "1", "divLineDashLen": "1", "divLineGapLen": "1", "showXAxisLine": "1", "xAxisLineThickness": "1", "xAxisLineColor": "#999999", "showAlternateHGridColor": "0" }, "data": chartdatum.source } }); visitChart.render(); $('#chartshow')[0].scrollIntoView(true); }); } $(".panel-heading").css("display", "inline-block"); }); socket.on('chartgoogledata', function(data) { var chartdetail = JSON.parse(data); var length = chartdetail.length; var width = 1400; var height = 700; var options = {}; chartdetail.forEach(function(val, index, theArray) { options = { title: val.caption, width: width, height: height, animation: { duration: 1000, easing: 'inAndOut', startup: true }, hAxis: { title: val.xAxisName }, vAxis: { title: val.yAxisName }, legend: { position: "bottom" } }; //console.log("Chart Type is : " + val.type); if (val.type == "geochart") { CreateGeoChart(val); } else if (val.type == "line") { CreateLineChart(val); } else if (val.type == "bar") { CreateColumnChart(val); } else if (val.type == "donut") { CreateDonutChart(val); } else if (val.type == "sankey") { CreateSankeyChart(val); } else if (val.type == "tree") { CreateTreeChart(val); }else if (val.type == "area") { CreateAreaChart(val); } else if (val.type == "bubble") { CreateBubbleChart(val); } else if (val.type == "trend") { CreateComboChart(val); } status = true; }); function CreateAreaChart(data) { var chartdatum = data; var result = []; result.push(Object.keys(chartdatum.source[0])); for (var i in chartdatum.source) { chartdatum.source[i].value = parseFloat(chartdatum.source[i].value); result.push(Object.values(chartdatum.source[i])); } google.charts.load('current', { 'packages': ['corechart'], //'mapsApiKey': '' }); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable(result); var chart = new google.visualization.AreaChart(document.getElementById('barchart')); chart.draw(data, options); } } function CreateBubbleChart(data) { var chartdatum = data; var result = []; result.push(Object.keys(chartdatum.source[0])); for (var i in chartdatum.source) { chartdatum.source[i].value = parseFloat(chartdatum.source[i].value); result.push(Object.values(chartdatum.source[i])); } google.charts.load('current', { 'packages': ['corechart']}); google.charts.setOnLoadCallback(drawChart); function drawChart() { //var data = google.visualization.arrayToDataTable(result); var data = google.visualization.arrayToDataTable([ ['ID', 'X', 'Y', 'Temperature'], ['', 80, 167, 120], ['', 79, 136, 130], ['', 78, 184, 50], ['', 72, 278, 230], ['', 81, 200, 210], ['', 72, 170, 100], ['', 68, 477, 80] ]); var options = { colorAxis: {colors: ['yellow', 'red']} }; var chart = new google.visualization.BubbleChart(document.getElementById('barchart')); chart.draw(data, options); } } // function CreateTreeChart(data) { // var chartdatum = data; // google.charts.load('current', { // 'packages': ['treemap'] // }); // google.charts.setOnLoadCallback(drawChart); // function drawChart() { // var data = google.visualization.arrayToDataTable([ // ['Location', 'Parent', 'Market trade volume (size)', 'Market increase/decrease (color)'], // ['Global', null, 0, 0], // ['America', 'Global', 0, 0], // ['Europe', 'Global', 0, 0], // ['Asia', 'Global', 0, 0], // ['Australia', 'Global', 0, 0], // ['Africa', 'Global', 0, 0], // ['Brazil', 'America', 11, 10], // ['USA', 'America', 52, 31], // ['Mexico', 'America', 24, 12], // ['Canada', 'America', 16, -23], // ['France', 'Europe', 42, -11], // ['Germany', 'Europe', 31, -2], // ['Sweden', 'Europe', 22, -13], // ['Italy', 'Europe', 17, 4], // ['UK', 'Europe', 21, -5], // ['China', 'Asia', 36, 4], // ['Japan', 'Asia', 20, -12], // ['India', 'Asia', 40, 63], // ['Laos', 'Asia', 4, 34], // ['Mongolia', 'Asia', 1, -5], // ['Israel', 'Asia', 12, 24], // ['Iran', 'Asia', 18, 13], // ['Pakistan', 'Asia', 11, -52], // ['Egypt', 'Africa', 21, 0], // ['S. Africa', 'Africa', 30, 43], // ['Sudan', 'Africa', 12, 2], // ['Congo', 'Africa', 10, 12], // ['Zaire', 'Africa', 8, 10] // ]); // var chart = new google.visualization.TreeMap(document.getElementById('barchart')); // chart.draw(data, { minColor: '#f00',midColor: '#ddd',maxColor: '#0d0',headerHeight: 15,fontColor: 'black',showScale: true}); // } // } function CreateTreeChart(data) { var chartdatum = data; var sourceData = chartdatum.source; google.charts.load('current', { 'packages': ['treemap'] }); google.charts.setOnLoadCallback(drawChart); var result = []; var j = 2; result.push(Object.keys(chartdatum.source[0])); result[0].push("size", "color"); result.push(["Global",null,0,0]); for (var i in chartdatum.source) { chartdatum.source[i].value = parseFloat(chartdatum.source[i].value); result.push(Object.values(chartdatum.source[i])); result[parseInt(j)+parseInt(i)].push(chartdatum.source[i].value); result[parseInt(j)+parseInt(i)].splice( 1, 0, 'Global'); } function drawChart() { var data = google.visualization.arrayToDataTable(result); /* var data = google.visualization.arrayToDataTable([ ['Product', 'Parent', 'Market trade volume (size)', 'Market increase/decrease (color)'], ['Products', null, 0, 0], ['Avastin', 'Products', 20, 20], ['Lipitor', 'Products', 35, 35], ['Herceptin', 'Products', 54, 54], ]);*/ var chart = new google.visualization.TreeMap(document.getElementById('barchart')); chart.draw(data,options); } } function CreateGeoChart(data) { var chartdatum = data; var result = []; //Need proper handling result.push(Object.keys(chartdatum.source[0])); for (var i in chartdatum.source) { chartdatum.source[i].value = parseFloat(chartdatum.source[i].value); result.push(Object.values(chartdatum.source[i])); } //result.push(Object.keys(source[0])); // for (var i in source) { // source[i].value = parseFloat(source[i].value); // result.push(Object.values(source[i])); // } google.charts.load('current', { 'packages': ['geochart'], 'mapsApiKey': '' }); google.charts.setOnLoadCallback(drawRegionsMap); function drawRegionsMap() { var data = google.visualization.arrayToDataTable(result); var chart = new google.visualization.GeoChart(document.getElementById('barchart')); chart.draw(data, options); } } function CreateDonutChart(data) { var chartdatum = data; var result = []; //Need proper handling result.push(Object.keys(chartdatum.source[0])); for (var i in chartdatum.source) { chartdatum.source[i].value = parseFloat(chartdatum.source[i].value); result.push(Object.values(chartdatum.source[i])); } google.charts.load('current', { 'packages': ['corechart'], 'mapsApiKey': '' }); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable(result); var options = { pieHole: 0.5, pieSliceTextStyle: { color: 'black', }, legend: 'none' }; var chart = new google.visualization.PieChart(document.getElementById('barchart')); chart.draw(data, options); } } // function CreateLineChart(data) { // //var chartdatum = data; // // if(length == 1){ // // width = 900; // // height= 500; // // } // // //var chartdetail = JSON.parse(data) // //var data = jQuery.parseJSON(JSON.stringify(data)) // console.log(data) // var chartdatum = data; // var result = []; // result.push(Object.keys(chartdatum.source[0])); // console.log(Object.keys(chartdatum.source[0])); // //console.log(data) // for (var i in chartdatum.source) { // chartdatum.source[i].value = parseFloat(chartdatum.source[i].value); // result.push(Object.values(chartdatum.source[i])); // } // // console.log(result) // google.charts.load('current', { // 'packages': ['corechart'], // // Note: you will need to get a mapsApiKey for your project. // // See: https://developers.google.com/chart/interactive/docs/basic_load_libs#load-settings // 'mapsApiKey': '' // }); // google.charts.setOnLoadCallback(drawChart); // // function drawChart() { // var data = google.visualization.arrayToDataTable(result); // // var chart = new google.visualization.LineChart(document.getElementById('barchart')); // // chart.draw(data, options); // } // // // } function CreateLineChart(data) { var chartdatum = data; var source1 = chartdatum.source; google.charts.load('current', { 'packages': ['corechart'] }); google.charts.setOnLoadCallback(drawChart); var result = []; final_json =[]; var new_key = Object.keys(chartdatum.source[0].values); new_key.sort(); new_key.unshift("country"); final_json.push(new_key); source1.forEach(function(Object){ final_json.push([Object.country,parseFloat(Object.values.Customer_MDM),parseFloat(Object.values.Email),parseFloat(Object.values.RDM),parseFloat(Object.values['Web/Clickstream/Portal'])]); }); console.log(final_json); function drawChart() { var data = google.visualization.arrayToDataTable(final_json); var chart = new google.visualization.LineChart(document.getElementById('barchart')); chart.draw(data, options); } } function CreateSankeyChart(data) { var chartdatum = data; /* var result = []; result.push(Object.keys(chartdatum.source[0])); for (var i in chartdatum.source) { chartdatum.source[i].value = parseFloat(chartdatum.source[i].value); result.push(Object.values(chartdatum.source[i])); }*/ google.charts.load('current', { 'packages': ['sankey'] }); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('string', 'From'); data.addColumn('string', 'To'); data.addColumn('number', 'Weight'); data.addRows([ [ 'A', 'X', 5 ], [ 'A', 'Y', 7 ], [ 'A', 'Z', 6 ], [ 'B', 'X', 2 ], [ 'B', 'Y', 9 ], [ 'B', 'Z', 4 ] ]); var options = { width: 600, }; var chart = new google.visualization.Sankey(document.getElementById('barchart')); chart.draw(data, options); } } function CreateColumnChart(data) { var chartdatum = data; var result = []; result.push(Object.keys(chartdatum.source[0])); for (var i in chartdatum.source) { chartdatum.source[i].value = parseFloat(chartdatum.source[i].value); result.push(Object.values(chartdatum.source[i])); } google.charts.load('current', { 'packages': ['corechart'], 'mapsApiKey': '' }); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable(result); var chart = new google.visualization.ColumnChart(document.getElementById('barchart')); chart.draw(data, options); } } function CreateComboChart(data) { var chartdatum = data; var result = []; result.push(Object.keys(chartdatum.source[0])); for (var i in chartdatum.source) { chartdatum.source[i].value = parseFloat(chartdatum.source[i].value); result.push(Object.values(chartdatum.source[i])); } google.charts.load('current', { 'packages': ['corechart'], 'mapsApiKey': '' }); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable(result); var chart = new google.visualization.ComboChart(document.getElementById('barchart')); chart.draw(data, options); } } }); }); function loadVoices() { var voices = speechSynthesis.getVoices(); // Loop through each of the voices. $('.input-field select').html(""); voices.forEach(function(voice, i) { // Create a new option element. if (voice.lang == 'en-US') { $('.input-field select').append($('