├── .gitignore ├── Dockerfile ├── INSTALL.md ├── Makefile ├── README.md ├── Rakefile ├── data ├── countries.json ├── web.pcap └── world.json ├── lib ├── axis-1.4.jar ├── bootstrap.sh ├── commons-discovery-20040218.194635.jar ├── dnsjava-2.1.1.jar ├── elastic-mapreduce-ruby │ ├── CHANGELOG │ ├── LICENSE.txt │ ├── NOTICE.txt │ ├── README │ ├── amazon │ │ ├── aws │ │ │ └── exceptions.rb │ │ ├── coral │ │ │ ├── awsquery.rb │ │ │ ├── awsquerychainhelper.rb │ │ │ ├── awsqueryhandler.rb │ │ │ ├── awsqueryurihandler.rb │ │ │ ├── call.rb │ │ │ ├── dispatcher.rb │ │ │ ├── ec2client.rb │ │ │ ├── elasticmapreduceclient.rb │ │ │ ├── handler.rb │ │ │ ├── httpdelegationhelper.rb │ │ │ ├── httpdestinationhandler.rb │ │ │ ├── httphandler.rb │ │ │ ├── identityhandler.rb │ │ │ ├── job.rb │ │ │ ├── logfactory.rb │ │ │ ├── option.rb │ │ │ ├── orchestrator.rb │ │ │ ├── querystringmap.rb │ │ │ ├── service.rb │ │ │ ├── simplelog.rb │ │ │ ├── urlencoding.rb │ │ │ ├── v0signaturehandler.rb │ │ │ ├── v0signaturehelper.rb │ │ │ ├── v1signaturehandler.rb │ │ │ ├── v1signaturehelper.rb │ │ │ ├── v2signaturehandler.rb │ │ │ └── v2signaturehelper.rb │ │ ├── retry_delegator.rb │ │ └── stderr_logger.rb │ ├── cacert.pem │ ├── client.rb │ ├── commands.rb │ ├── credentials.rb │ ├── ec2_client_wrapper.rb │ ├── elastic-mapreduce │ ├── elastic-mapreduce-cli.rb │ ├── json.rb │ ├── json │ │ ├── lexer.rb │ │ └── objects.rb │ ├── run_tests.rb │ ├── samples │ │ ├── freebase │ │ │ └── code │ │ │ │ └── freebase_jobflow.json │ │ ├── similarity │ │ │ └── lastfm_jobflow.json │ │ └── wordSplitter.py │ ├── simple_executor.rb │ ├── simple_logger.rb │ ├── tests │ │ ├── commands_test.rb │ │ ├── credentials.json │ │ └── example.json │ ├── uuidtools.rb │ └── uuidtools │ │ └── version.rb ├── kraken-pcap-1.6.0.jar ├── mongo-2.9.0.jar ├── mongo-hadoop-core-1.1.0-SNAPSHOT.jar ├── mongo-hadoop-pig-1.1.0-SNAPSHOT.jar ├── packetpig-with-dependencies.jar ├── packetpig.jar ├── packetpig │ ├── .classpath │ ├── .idea │ │ ├── .name │ │ ├── codeStyleSettings.xml │ │ ├── compiler.xml │ │ ├── copyright │ │ │ └── profiles_settings.xml │ │ ├── encodings.xml │ │ ├── libraries │ │ │ ├── Maven__ant_ant_1_6_5.xml │ │ │ ├── Maven__asm_asm_3_2.xml │ │ │ ├── Maven__com_thoughtworks_paranamer_paranamer_2_2.xml │ │ │ ├── Maven__com_thoughtworks_paranamer_paranamer_ant_2_2.xml │ │ │ ├── Maven__com_thoughtworks_paranamer_paranamer_generator_2_2.xml │ │ │ ├── Maven__com_thoughtworks_qdox_qdox_1_10_1.xml │ │ │ ├── Maven__commons_beanutils_commons_beanutils_1_7_0.xml │ │ │ ├── Maven__commons_beanutils_commons_beanutils_core_1_8_0.xml │ │ │ ├── Maven__commons_cli_commons_cli_1_2.xml │ │ │ ├── Maven__commons_codec_commons_codec_1_4.xml │ │ │ ├── Maven__commons_collections_commons_collections_3_2_1.xml │ │ │ ├── Maven__commons_configuration_commons_configuration_1_6.xml │ │ │ ├── Maven__commons_digester_commons_digester_1_8.xml │ │ │ ├── Maven__commons_discovery_commons_discovery_20040218_194635.xml │ │ │ ├── Maven__commons_el_commons_el_1_0.xml │ │ │ ├── Maven__commons_httpclient_commons_httpclient_3_1.xml │ │ │ ├── Maven__commons_lang_commons_lang_2_5.xml │ │ │ ├── Maven__commons_logging_commons_logging_1_0_4.xml │ │ │ ├── Maven__commons_net_commons_net_1_4_1.xml │ │ │ ├── Maven__dnsjava_dnsjava_2_0_6.xml │ │ │ ├── Maven__hsqldb_hsqldb_1_8_0_10.xml │ │ │ ├── Maven__junit_junit_4_8_1.xml │ │ │ ├── Maven__net_java_dev_jets3t_jets3t_0_7_1.xml │ │ │ ├── Maven__net_sf_kosmosfs_kfs_0_3.xml │ │ │ ├── Maven__org_apache_axis_axis_1_4.xml │ │ │ ├── Maven__org_apache_commons_commons_math_2_1.xml │ │ │ ├── Maven__org_apache_hadoop_avro_1_3_2.xml │ │ │ ├── Maven__org_apache_hadoop_hadoop_core_1_0_3.xml │ │ │ ├── Maven__org_apache_pig_pig_0_9_2.xml │ │ │ ├── Maven__org_codehaus_jackson_jackson_core_asl_1_4_0.xml │ │ │ ├── Maven__org_codehaus_jackson_jackson_mapper_asl_1_4_0.xml │ │ │ ├── Maven__org_eclipse_jdt_core_3_1_1.xml │ │ │ ├── Maven__org_krakenapps_kraken_api_1_6_0.xml │ │ │ ├── Maven__org_krakenapps_kraken_pcap_1_6_0.xml │ │ │ ├── Maven__org_mortbay_jetty_jetty_6_1_26.xml │ │ │ ├── Maven__org_mortbay_jetty_jetty_util_6_1_26.xml │ │ │ ├── Maven__org_mortbay_jetty_jsp_2_1_6_1_14.xml │ │ │ ├── Maven__org_mortbay_jetty_jsp_api_2_1_6_1_14.xml │ │ │ ├── Maven__org_mortbay_jetty_servlet_api_2_5_20081211.xml │ │ │ ├── Maven__org_mortbay_jetty_servlet_api_2_5_6_1_14.xml │ │ │ ├── Maven__org_slf4j_slf4j_api_1_6_4.xml │ │ │ ├── Maven__org_slf4j_slf4j_simple_1_5_6.xml │ │ │ ├── Maven__oro_oro_2_0_8.xml │ │ │ ├── Maven__tomcat_jasper_compiler_5_5_12.xml │ │ │ ├── Maven__tomcat_jasper_runtime_5_5_12.xml │ │ │ └── Maven__xmlenc_xmlenc_0_52.xml │ │ ├── misc.xml │ │ ├── modules.xml │ │ ├── scopes │ │ │ └── scope_settings.xml │ │ └── vcs.xml │ ├── .project │ ├── packetpig.iml │ ├── pig.iml │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ ├── maxmind │ │ │ └── geoip │ │ │ │ ├── Country.java │ │ │ │ ├── DatabaseInfo.java │ │ │ │ ├── Location.java │ │ │ │ ├── LookupService.java │ │ │ │ ├── Region.java │ │ │ │ ├── regionName.java │ │ │ │ └── timeZone.java │ │ │ └── packetloop │ │ │ └── packetpig │ │ │ ├── loaders │ │ │ └── pcap │ │ │ │ ├── PcapFSDataInputStream.java │ │ │ │ ├── PcapInputFormat.java │ │ │ │ ├── PcapLoader.java │ │ │ │ ├── PcapRecordReader.java │ │ │ │ ├── PcapStreamWriter.java │ │ │ │ ├── StreamSink.java │ │ │ │ ├── StreamingPcapRecordReader.java │ │ │ │ ├── conversation │ │ │ │ ├── ConversationLoader.java │ │ │ │ └── ConversationRecordReader.java │ │ │ │ ├── detection │ │ │ │ ├── FingerprintLoader.java │ │ │ │ ├── FingerprintRecordReader.java │ │ │ │ ├── FingerprintTuple.java │ │ │ │ ├── SnortLoader.java │ │ │ │ └── SnortRecordReader.java │ │ │ │ ├── file │ │ │ │ ├── ConversationFileLoader.java │ │ │ │ └── ConversationFileRecordReader.java │ │ │ │ ├── packet │ │ │ │ ├── DnsAllPacketLoader.java │ │ │ │ ├── DnsPacketAllRecordReader.java │ │ │ │ ├── DnsPacketLoader.java │ │ │ │ ├── DnsPacketRecordReader.java │ │ │ │ ├── PacketFilter.java │ │ │ │ ├── PacketLoader.java │ │ │ │ ├── PacketNgramLoader.java │ │ │ │ ├── PacketNgramRecordReader.java │ │ │ │ ├── PacketRecordReader.java │ │ │ │ └── PacketTuple.java │ │ │ │ └── protocol │ │ │ │ ├── DNSConversationLoader.java │ │ │ │ ├── DNSConversationRecordReader.java │ │ │ │ ├── HTTPConversationLoader.java │ │ │ │ └── HTTPConversationRecordReader.java │ │ │ ├── storage │ │ │ ├── JsonMetadata.java │ │ │ └── JsonStorage.java │ │ │ └── udf │ │ │ ├── geoip │ │ │ ├── ASNum.java │ │ │ ├── City.java │ │ │ ├── Country.java │ │ │ └── LatLon.java │ │ │ └── util │ │ │ └── Explode.java │ │ └── test │ │ └── java │ │ └── .gitkeep ├── piggybank.jar ├── run_emr ├── scripts │ ├── country_finder.rb │ ├── dns_parser.py │ ├── impacket │ │ ├── ChangeLog │ │ ├── LICENSE │ │ ├── MANIFEST.in │ │ ├── README │ │ ├── examples │ │ │ ├── chain.py │ │ │ ├── crapchain.py │ │ │ ├── exploit.py │ │ │ ├── ifmap.py │ │ │ ├── loopchain.py │ │ │ ├── ms05-039-crash.py │ │ │ ├── nmapAnswerMachine.py │ │ │ ├── oochain.py │ │ │ ├── opdump.py │ │ │ ├── os_ident.py │ │ │ ├── ping.py │ │ │ ├── rpcdump.py │ │ │ ├── samrdump.py │ │ │ ├── services.py │ │ │ ├── smbcat.py │ │ │ ├── smbclient.py │ │ │ ├── smbrelayx │ │ │ │ ├── creds.txt │ │ │ │ ├── smb.conf │ │ │ │ └── smbrelayx.py │ │ │ ├── smbserver │ │ │ │ ├── creds.txt │ │ │ │ ├── simple_server.py │ │ │ │ └── smb.conf │ │ │ ├── sniff.py │ │ │ ├── sniffer.py │ │ │ ├── split.py │ │ │ ├── test_wkssvc.py │ │ │ ├── tracer.py │ │ │ ├── uncrc32.py │ │ │ └── win_echod.py │ │ ├── impacket │ │ │ ├── Dot11Crypto.py │ │ │ ├── Dot11KeyManager.py │ │ │ ├── ICMP6.py │ │ │ ├── IP6.py │ │ │ ├── IP6_Address.py │ │ │ ├── ImpactDecoder.py │ │ │ ├── ImpactPacket.py │ │ │ ├── NDP.py │ │ │ ├── __init__.py │ │ │ ├── cdp.py │ │ │ ├── dcerpc │ │ │ │ ├── __init__.py │ │ │ │ ├── conv.py │ │ │ │ ├── dcerpc.py │ │ │ │ ├── dcerpc_v4.py │ │ │ │ ├── dcom.py │ │ │ │ ├── epm.py │ │ │ │ ├── mgmt.py │ │ │ │ ├── ndrutils.py │ │ │ │ ├── printer.py │ │ │ │ ├── samr.py │ │ │ │ ├── srvsvc.py │ │ │ │ ├── svcctl.py │ │ │ │ ├── transport.py │ │ │ │ ├── winreg.py │ │ │ │ └── wkssvc.py │ │ │ ├── dhcp.py │ │ │ ├── dns.py │ │ │ ├── dot11.py │ │ │ ├── nmb.py │ │ │ ├── ntlm.py │ │ │ ├── pcapfile.py │ │ │ ├── smb.py │ │ │ ├── smbserver.py │ │ │ ├── structure.py │ │ │ ├── testcases │ │ │ │ ├── ImpactPacket │ │ │ │ │ ├── runalltestcases.bat │ │ │ │ │ ├── runalltestcases.sh │ │ │ │ │ ├── test-DCERPC_Auth.py │ │ │ │ │ ├── test-ICMP6.py │ │ │ │ │ ├── test-IP6.py │ │ │ │ │ ├── test-IP6_Address.py │ │ │ │ │ ├── test-TCP.py │ │ │ │ │ └── test-ntlm.py │ │ │ │ └── dot11 │ │ │ │ │ ├── runalltestcases.bat │ │ │ │ │ ├── runalltestcases.sh │ │ │ │ │ ├── test-Dot11Base.py │ │ │ │ │ ├── test-Dot11Decoder.py │ │ │ │ │ ├── test-Dot11HierarchicalUpdate.py │ │ │ │ │ ├── test-FrameControlACK.py │ │ │ │ │ ├── test-FrameControlCFEnd.py │ │ │ │ │ ├── test-FrameControlCFEndCFACK.py │ │ │ │ │ ├── test-FrameControlCTS.py │ │ │ │ │ ├── test-FrameControlPSPoll.py │ │ │ │ │ ├── test-FrameControlRTS.py │ │ │ │ │ ├── test-FrameData.py │ │ │ │ │ ├── test-FrameManagement.py │ │ │ │ │ ├── test-FrameManagementAssociationRequest.py │ │ │ │ │ ├── test-FrameManagementAssociationResponse.py │ │ │ │ │ ├── test-FrameManagementAuthentication.py │ │ │ │ │ ├── test-FrameManagementDeauthentication.py │ │ │ │ │ ├── test-FrameManagementDisassociation.py │ │ │ │ │ ├── test-FrameManagementProbeRequest.py │ │ │ │ │ ├── test-FrameManagementProbeResponse.py │ │ │ │ │ ├── test-FrameManagementReassociationRequest.py │ │ │ │ │ ├── test-FrameManagementReassociationResponse.py │ │ │ │ │ ├── test-RadioTap.py │ │ │ │ │ ├── test-RadioTapDecoder.py │ │ │ │ │ ├── test-WEPDecoder.py │ │ │ │ │ ├── test-WEPEncoder.py │ │ │ │ │ ├── test-WPA.py │ │ │ │ │ └── test-WPA2.py │ │ │ └── uuid.py │ │ └── setup.py │ ├── readme.py │ ├── reduce-trigram.py │ └── tcp.py ├── slf4j-api-1.6.4.jar ├── src │ ├── Python-2.7.2.tar.bz2 │ ├── daq-1.1.1.tar.gz │ ├── ez_setup.py │ ├── libdnet-1.12.tgz │ ├── libpcap-1.3.0.tar.gz │ ├── pynids-0.6.1.tar.gz │ ├── scapy-latest.tar.gz │ └── snort-2.9.3.1.tar.gz └── tailer ├── packetpig.png ├── pig.sh ├── pig ├── benchmarks │ └── pcap-loader-count.pig ├── charts │ ├── ngram-chart.pig │ └── ts-snort-country-chart.pig ├── choropleth │ └── choropleth-snort.pig ├── cube │ └── cube-ngram.pig ├── examples │ ├── attacker_useragents.pig │ ├── bandwidth.pig │ ├── basic_data.pig │ ├── basic_grouping.pig │ ├── basic_http.pig │ ├── basic_joining.pig │ ├── basic_packets.pig │ ├── basic_snort.pig │ ├── basic_summary.pig │ ├── binning.pig │ ├── conversation_info.pig │ ├── conversations.pig │ ├── dns.pig │ ├── dns_all.pig │ ├── dns_java.pig │ ├── dns_response_ttl.pig │ ├── extract_files.pig │ ├── histogram.pig │ ├── http.pig │ ├── http_fields.pig │ ├── mongodb │ │ └── binning.pig │ ├── ngram.pig │ ├── p0f.pig │ ├── p0f_fingerprint.pig │ ├── p0f_http.pig │ ├── packet_latency_histogram.pig │ ├── packets.pig │ ├── ports_ordered_sum.pig │ ├── protocol.pig │ ├── protocol_size_histogram.pig │ ├── snort.pig │ ├── snort_breakdown.pig │ ├── snort_breakdown2.pig │ ├── snort_comparison.pig │ ├── snort_country.pig │ ├── snort_location.pig │ ├── src_distinct_destinations.pig │ ├── src_distinct_ports.pig │ ├── src_dst_tuples.pig │ ├── uber.pig │ ├── user_agent.pig │ └── user_info.pig ├── globe │ └── globe-snort.pig ├── include-emr.pig ├── include-hdfs.pig ├── include.pig └── ubigraph │ └── ubigraph-dns.pig ├── pigrun.py ├── prepare-hdfs.sh ├── put.sh ├── r └── examples │ ├── attacker_useragents.r │ ├── bandwidth.r │ ├── binning.r │ ├── conversations.r │ ├── dns_response_ttl.r │ ├── dns_response_ttl_facets.r │ ├── extract_files.r │ ├── histogram.r │ ├── layered.r │ ├── p0f_fingerprint.r │ ├── protocol_size_histogram.r │ └── snort.r └── vis ├── charts └── main.html ├── cube └── cube.html ├── globe └── globe.html ├── lib ├── d3 │ ├── .gitignore │ ├── .gitmodules │ ├── .npmignore │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── d3.chart.js │ ├── d3.chart.min.js │ ├── d3.csv.js │ ├── d3.csv.min.js │ ├── d3.geo.js │ ├── d3.geo.min.js │ ├── d3.geom.js │ ├── d3.geom.min.js │ ├── d3.js │ ├── d3.layout.js │ ├── d3.layout.min.js │ ├── d3.min.js │ ├── d3.time.js │ ├── d3.time.min.js │ ├── examples │ │ ├── albers │ │ │ └── albers.html │ │ ├── area │ │ │ ├── area-radial.html │ │ │ └── area.html │ │ ├── axis │ │ │ ├── axis-alternating.html │ │ │ ├── axis-ggplot2.html │ │ │ ├── axis-multiples.html │ │ │ ├── axis-orientations.html │ │ │ └── axis-transition.html │ │ ├── azimuthal │ │ │ ├── azimuthal.css │ │ │ ├── azimuthal.html │ │ │ └── azimuthal.js │ │ ├── bar │ │ │ ├── bar-hierarchy.html │ │ │ └── bar.html │ │ ├── bonne │ │ │ └── bonne.html │ │ ├── box │ │ │ ├── box.css │ │ │ ├── box.html │ │ │ └── box.js │ │ ├── brush │ │ │ ├── brush-ordinal.html │ │ │ ├── brush-x.html │ │ │ ├── brush-y.html │ │ │ └── brush.html │ │ ├── bubble │ │ │ ├── bubble.css │ │ │ ├── bubble.html │ │ │ └── bubble.js │ │ ├── bullet │ │ │ ├── bullet.css │ │ │ ├── bullet.html │ │ │ ├── bullet.js │ │ │ └── bullets.json │ │ ├── bundle │ │ │ ├── bundle-radial.css │ │ │ ├── bundle-radial.html │ │ │ ├── bundle-radial.js │ │ │ ├── bundle-treemap.css │ │ │ ├── bundle-treemap.html │ │ │ ├── bundle-treemap.js │ │ │ └── packages.js │ │ ├── button.css │ │ ├── calendar │ │ │ ├── calendar.css │ │ │ ├── dji-area.html │ │ │ ├── dji.html │ │ │ ├── dji.js │ │ │ ├── vix.html │ │ │ └── vix.js │ │ ├── cartogram │ │ │ ├── cartogram.css │ │ │ ├── cartogram.html │ │ │ ├── cartogram.js │ │ │ ├── demers.css │ │ │ ├── demers.html │ │ │ ├── demers.js │ │ │ ├── dorling.css │ │ │ ├── dorling.html │ │ │ └── dorling.js │ │ ├── chord │ │ │ ├── chord-flare.html │ │ │ ├── chord.css │ │ │ ├── chord.html │ │ │ └── chord.js │ │ ├── choropleth │ │ │ ├── choropleth-area.html │ │ │ ├── choropleth-bounds.html │ │ │ ├── choropleth.css │ │ │ ├── choropleth.html │ │ │ ├── choropleth.js │ │ │ └── unemployment.json │ │ ├── clock │ │ │ ├── clock.css │ │ │ ├── clock.html │ │ │ └── clock.js │ │ ├── cluster │ │ │ ├── cluster-radial.html │ │ │ ├── cluster-radial.js │ │ │ ├── cluster.css │ │ │ ├── cluster.html │ │ │ └── cluster.js │ │ ├── contour │ │ │ └── contour.html │ │ ├── crimea │ │ │ ├── crimea-stacked-area.html │ │ │ └── crimea-stacked-bar.html │ │ ├── custom │ │ │ └── custom.html │ │ ├── data │ │ │ ├── README.md │ │ │ ├── faithful.json │ │ │ ├── flare-imports.json │ │ │ ├── flare.json │ │ │ ├── sample.html │ │ │ ├── sample.json │ │ │ ├── sample.txt │ │ │ ├── sample.xml │ │ │ ├── us-borders.json │ │ │ ├── us-counties.json │ │ │ ├── us-state-centroids.json │ │ │ ├── us-states.json │ │ │ └── world-countries.json │ │ ├── delaunay │ │ │ └── delaunay.html │ │ ├── donut │ │ │ └── donut.html │ │ ├── dot │ │ │ └── dot.html │ │ ├── drag │ │ │ └── drag.html │ │ ├── force │ │ │ ├── README │ │ │ ├── force-bounds.html │ │ │ ├── force-cluster.html │ │ │ ├── force-collapsible.html │ │ │ ├── force-dynamic.html │ │ │ ├── force-map.html │ │ │ ├── force-multi-foci.html │ │ │ ├── force.css │ │ │ ├── force.html │ │ │ ├── force.js │ │ │ └── miserables.json │ │ ├── great-arc │ │ │ └── great-arc.html │ │ ├── hello-world │ │ │ ├── hello-data-key.html │ │ │ ├── hello-data-nested-key.html │ │ │ ├── hello-data-nested.html │ │ │ ├── hello-data.html │ │ │ ├── hello-event.html │ │ │ ├── hello-node-key.html │ │ │ ├── hello-order.html │ │ │ ├── hello-sort.html │ │ │ ├── hello-transform.html │ │ │ ├── hello-transition-undefined.html │ │ │ ├── hello-transition.html │ │ │ ├── hello-webkit-transition.html │ │ │ ├── select-enter-add.html │ │ │ └── selectAll-enter-add.html │ │ ├── histogram │ │ │ └── histogram.html │ │ ├── horizon │ │ │ ├── horizon.css │ │ │ ├── horizon.html │ │ │ ├── horizon.js │ │ │ └── unemployment.json │ │ ├── hull │ │ │ └── hull.html │ │ ├── kde │ │ │ ├── kde.css │ │ │ ├── kde.html │ │ │ └── kde.js │ │ ├── line │ │ │ ├── line.css │ │ │ ├── line.html │ │ │ └── line.js │ │ ├── marimekko │ │ │ ├── marimekko.html │ │ │ └── marimekko.json │ │ ├── marker │ │ │ └── marker.html │ │ ├── mercator │ │ │ └── mercator.html │ │ ├── moire │ │ │ └── moire.html │ │ ├── node-canvas │ │ │ └── us-counties.js │ │ ├── pack │ │ │ ├── pack.css │ │ │ ├── pack.html │ │ │ └── pack.js │ │ ├── parallel │ │ │ └── parallel.html │ │ ├── partition │ │ │ ├── partition-icicle-zoom.html │ │ │ ├── partition-icicle.html │ │ │ ├── partition-sunburst-zoom.html │ │ │ ├── partition-sunburst.html │ │ │ └── partition-sunburst.js │ │ ├── pie │ │ │ ├── pie-transition.html │ │ │ └── pie.html │ │ ├── population │ │ │ ├── population.css │ │ │ ├── population.html │ │ │ └── population.js │ │ ├── qq │ │ │ ├── qq.css │ │ │ ├── qq.html │ │ │ ├── qq.js │ │ │ ├── stats.js │ │ │ └── turkers.json │ │ ├── quadtree │ │ │ └── quadtree.html │ │ ├── showreel │ │ │ └── showreel.html │ │ ├── sizzle │ │ │ └── sizzle.html │ │ ├── sort │ │ │ ├── sort.css │ │ │ ├── sort.html │ │ │ └── sort.js │ │ ├── spline │ │ │ ├── spline.css │ │ │ ├── spline.html │ │ │ └── spline.js │ │ ├── splom │ │ │ ├── flowers.json │ │ │ ├── splom.css │ │ │ ├── splom.html │ │ │ └── splom.js │ │ ├── stream │ │ │ ├── stack.css │ │ │ ├── stack.html │ │ │ ├── stack.js │ │ │ ├── stream.css │ │ │ ├── stream.html │ │ │ ├── stream.js │ │ │ └── stream_layers.js │ │ ├── superformula │ │ │ ├── dot.html │ │ │ ├── explorer.html │ │ │ ├── superformula.html │ │ │ └── superformula.js │ │ ├── symbol-map │ │ │ └── symbol-map.html │ │ ├── touch │ │ │ └── touch.html │ │ ├── transform │ │ │ ├── test.html │ │ │ └── transform.html │ │ ├── tree │ │ │ ├── tree-dynamic.html │ │ │ ├── tree-interactive.html │ │ │ ├── tree-radial.html │ │ │ ├── tree-radial.js │ │ │ ├── tree.css │ │ │ ├── tree.html │ │ │ └── tree.js │ │ ├── treemap │ │ │ ├── treemap-svg.html │ │ │ ├── treemap-svg.js │ │ │ ├── treemap.css │ │ │ ├── treemap.html │ │ │ └── treemap.js │ │ ├── voroboids │ │ │ ├── boid.js │ │ │ ├── voroboids.css │ │ │ ├── voroboids.html │ │ │ └── voroboids.js │ │ ├── voronoi │ │ │ ├── voronoi.css │ │ │ ├── voronoi.html │ │ │ └── voronoi.js │ │ ├── zoom-pan │ │ │ ├── zoom-pan-transform.html │ │ │ └── zoom-pan.html │ │ └── zoom │ │ │ └── zoom.html │ ├── lib │ │ ├── colorbrewer │ │ │ ├── LICENSE │ │ │ ├── colorbrewer.css │ │ │ └── colorbrewer.js │ │ ├── jit │ │ │ └── LICENSE │ │ ├── jquery-ui │ │ │ ├── LICENSE │ │ │ ├── images │ │ │ │ ├── ui-bg_diagonals-thick_18_b81900_40x40.png │ │ │ │ ├── ui-bg_diagonals-thick_20_666666_40x40.png │ │ │ │ ├── ui-bg_flat_10_000000_40x100.png │ │ │ │ ├── ui-bg_glass_100_f6f6f6_1x400.png │ │ │ │ ├── ui-bg_glass_100_fdf5ce_1x400.png │ │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ │ ├── ui-bg_gloss-wave_35_f6a828_500x100.png │ │ │ │ ├── ui-bg_highlight-soft_100_eeeeee_1x100.png │ │ │ │ ├── ui-bg_highlight-soft_75_ffe45c_1x100.png │ │ │ │ ├── ui-icons_222222_256x240.png │ │ │ │ ├── ui-icons_228ef1_256x240.png │ │ │ │ ├── ui-icons_ef8c08_256x240.png │ │ │ │ ├── ui-icons_ffd27a_256x240.png │ │ │ │ └── ui-icons_ffffff_256x240.png │ │ │ ├── jquery-ui.css │ │ │ └── jquery-ui.min.js │ │ ├── jquery │ │ │ ├── LICENSE │ │ │ ├── jquery.js │ │ │ └── jquery.min.js │ │ ├── polymaps │ │ │ └── LICENSE │ │ ├── protovis │ │ │ └── LICENSE │ │ ├── science │ │ │ ├── LICENSE │ │ │ ├── science.js │ │ │ ├── science.lin.js │ │ │ ├── science.lin.min.js │ │ │ ├── science.min.js │ │ │ ├── science.stats.js │ │ │ └── science.stats.min.js │ │ └── sizzle │ │ │ ├── LICENSE │ │ │ ├── sizzle.js │ │ │ └── sizzle.min.js │ ├── package.json │ ├── src │ │ ├── behavior │ │ │ ├── behavior.js │ │ │ ├── drag.js │ │ │ └── zoom.js │ │ ├── chart │ │ │ ├── box.js │ │ │ ├── bullet.js │ │ │ ├── chart.js │ │ │ ├── horizon.js │ │ │ └── qq.js │ │ ├── compat │ │ │ ├── date.js │ │ │ └── style.js │ │ ├── core │ │ │ ├── array.js │ │ │ ├── ascending.js │ │ │ ├── bisect.js │ │ │ ├── collapse.js │ │ │ ├── core.js │ │ │ ├── descending.js │ │ │ ├── dispatch.js │ │ │ ├── ease.js │ │ │ ├── entries.js │ │ │ ├── event.js │ │ │ ├── extent.js │ │ │ ├── first.js │ │ │ ├── format.js │ │ │ ├── formatPrefix.js │ │ │ ├── functor.js │ │ │ ├── hsl.js │ │ │ ├── html.js │ │ │ ├── interpolate.js │ │ │ ├── json.js │ │ │ ├── keys.js │ │ │ ├── last.js │ │ │ ├── max.js │ │ │ ├── mean.js │ │ │ ├── median.js │ │ │ ├── merge.js │ │ │ ├── min.js │ │ │ ├── nest.js │ │ │ ├── noop.js │ │ │ ├── ns.js │ │ │ ├── number.js │ │ │ ├── permute.js │ │ │ ├── quantile.js │ │ │ ├── random.js │ │ │ ├── range.js │ │ │ ├── rebind.js │ │ │ ├── requote.js │ │ │ ├── rgb.js │ │ │ ├── round.js │ │ │ ├── selection-append.js │ │ │ ├── selection-attr.js │ │ │ ├── selection-call.js │ │ │ ├── selection-classed.js │ │ │ ├── selection-data.js │ │ │ ├── selection-each.js │ │ │ ├── selection-empty.js │ │ │ ├── selection-enter-select.js │ │ │ ├── selection-enter.js │ │ │ ├── selection-filter.js │ │ │ ├── selection-html.js │ │ │ ├── selection-insert.js │ │ │ ├── selection-map.js │ │ │ ├── selection-node.js │ │ │ ├── selection-on.js │ │ │ ├── selection-order.js │ │ │ ├── selection-property.js │ │ │ ├── selection-remove.js │ │ │ ├── selection-root.js │ │ │ ├── selection-select.js │ │ │ ├── selection-selectAll.js │ │ │ ├── selection-sort.js │ │ │ ├── selection-style.js │ │ │ ├── selection-text.js │ │ │ ├── selection-transition.js │ │ │ ├── selection.js │ │ │ ├── split.js │ │ │ ├── sum.js │ │ │ ├── text.js │ │ │ ├── this.js │ │ │ ├── timer.js │ │ │ ├── transform.js │ │ │ ├── transition-attr.js │ │ │ ├── transition-delay.js │ │ │ ├── transition-duration.js │ │ │ ├── transition-each.js │ │ │ ├── transition-remove.js │ │ │ ├── transition-select.js │ │ │ ├── transition-selectAll.js │ │ │ ├── transition-style.js │ │ │ ├── transition-text.js │ │ │ ├── transition-transition.js │ │ │ ├── transition.js │ │ │ ├── transpose.js │ │ │ ├── uninterpolate.js │ │ │ ├── values.js │ │ │ ├── xhr.js │ │ │ ├── xml.js │ │ │ └── zip.js │ │ ├── csv │ │ │ ├── csv.js │ │ │ ├── format.js │ │ │ └── parse.js │ │ ├── end.js │ │ ├── externs.js │ │ ├── geo │ │ │ ├── albers.js │ │ │ ├── azimuthal.js │ │ │ ├── bonne.js │ │ │ ├── bounds.js │ │ │ ├── circle.js │ │ │ ├── equirectangular.js │ │ │ ├── geo.js │ │ │ ├── greatArc.js │ │ │ ├── greatCircle.js │ │ │ ├── mercator.js │ │ │ ├── path.js │ │ │ └── type.js │ │ ├── geom │ │ │ ├── contour.js │ │ │ ├── delaunay.js │ │ │ ├── geom.js │ │ │ ├── hull.js │ │ │ ├── polygon.js │ │ │ ├── quadtree.js │ │ │ └── voronoi.js │ │ ├── layout │ │ │ ├── bundle.js │ │ │ ├── chord.js │ │ │ ├── cluster.js │ │ │ ├── force.js │ │ │ ├── hierarchy.js │ │ │ ├── histogram.js │ │ │ ├── layout.js │ │ │ ├── pack.js │ │ │ ├── partition.js │ │ │ ├── pie.js │ │ │ ├── stack.js │ │ │ ├── tree.js │ │ │ └── treemap.js │ │ ├── package.js │ │ ├── scale │ │ │ ├── bilinear.js │ │ │ ├── category.js │ │ │ ├── linear.js │ │ │ ├── log.js │ │ │ ├── nice.js │ │ │ ├── ordinal.js │ │ │ ├── polylinear.js │ │ │ ├── pow.js │ │ │ ├── quantile.js │ │ │ ├── quantize.js │ │ │ ├── scale.js │ │ │ └── sqrt.js │ │ ├── start.js │ │ ├── svg │ │ │ ├── arc.js │ │ │ ├── area-radial.js │ │ │ ├── area.js │ │ │ ├── axis.js │ │ │ ├── brush.js │ │ │ ├── chord.js │ │ │ ├── diagonal-radial.js │ │ │ ├── diagonal.js │ │ │ ├── line-radial.js │ │ │ ├── line.js │ │ │ ├── mouse.js │ │ │ ├── svg.js │ │ │ ├── symbol.js │ │ │ └── touches.js │ │ └── time │ │ │ ├── day.js │ │ │ ├── days.js │ │ │ ├── format-iso.js │ │ │ ├── format-utc.js │ │ │ ├── format.js │ │ │ ├── hour.js │ │ │ ├── hours.js │ │ │ ├── minute.js │ │ │ ├── minutes.js │ │ │ ├── month.js │ │ │ ├── months.js │ │ │ ├── range.js │ │ │ ├── scale-utc.js │ │ │ ├── scale.js │ │ │ ├── second.js │ │ │ ├── seconds.js │ │ │ ├── time.js │ │ │ ├── week.js │ │ │ ├── weeks.js │ │ │ ├── year.js │ │ │ └── years.js │ └── test │ │ ├── core │ │ ├── ascending-test.js │ │ ├── bisect-test.js │ │ ├── descending-test.js │ │ ├── dispatch-test.js │ │ ├── ease-test.js │ │ ├── entries-test.js │ │ ├── extent-test.js │ │ ├── first-test.js │ │ ├── format-test.js │ │ ├── formatPrefix-test.js │ │ ├── functor-test.js │ │ ├── hsl-test.js │ │ ├── html-test.js │ │ ├── interpolate-test.js │ │ ├── json-test.js │ │ ├── keys-test.js │ │ ├── last-test.js │ │ ├── max-test.js │ │ ├── mean-test.js │ │ ├── median-test.js │ │ ├── merge-test.js │ │ ├── min-test.js │ │ ├── nest-test.js │ │ ├── ns-test.js │ │ ├── permute-test.js │ │ ├── quantile-test.js │ │ ├── range-test.js │ │ ├── rebind-test.js │ │ ├── requote-test.js │ │ ├── rgb-test.js │ │ ├── round-test.js │ │ ├── select-test.js │ │ ├── selectAll-test.js │ │ ├── selection-append-test.js │ │ ├── selection-attr-test.js │ │ ├── selection-call-test.js │ │ ├── selection-classed-test.js │ │ ├── selection-data-test.js │ │ ├── selection-each-test.js │ │ ├── selection-empty-test.js │ │ ├── selection-filter-test.js │ │ ├── selection-html-test.js │ │ ├── selection-insert-test.js │ │ ├── selection-map-test.js │ │ ├── selection-node-test.js │ │ ├── selection-on-test.js │ │ ├── selection-order-test.js │ │ ├── selection-property-test.js │ │ ├── selection-remove-test.js │ │ ├── selection-select-test.js │ │ ├── selection-selectAll-test.js │ │ ├── selection-sort-test.js │ │ ├── selection-style-test.js │ │ ├── selection-test.js │ │ ├── selection-text-test.js │ │ ├── split-test.js │ │ ├── sum-test.js │ │ ├── text-test.js │ │ ├── timer-test.js │ │ ├── transition-test-attr.js │ │ ├── transition-test-attrTween.js │ │ ├── transition-test-call.js │ │ ├── transition-test-delay.js │ │ ├── transition-test-duration.js │ │ ├── transition-test-each.js │ │ ├── transition-test-id.js │ │ ├── transition-test-remove.js │ │ ├── transition-test-select.js │ │ ├── transition-test-selectAll.js │ │ ├── transition-test-style.js │ │ ├── transition-test-styleTween.js │ │ ├── transition-test-text.js │ │ ├── transition-test-time.js │ │ ├── transition-test-transition.js │ │ ├── transition-test-tween.js │ │ ├── transition-test.js │ │ ├── transpose-test.js │ │ ├── values-test.js │ │ ├── version-test.js │ │ ├── xhr-test.js │ │ ├── xml-test.js │ │ └── zip-test.js │ │ ├── csv │ │ ├── csv-test.js │ │ ├── format-test.js │ │ └── parse-test.js │ │ ├── env-assert.js │ │ ├── env-fragment.js │ │ ├── env-xhr.js │ │ ├── env.js │ │ ├── geo │ │ ├── albers-test.js │ │ ├── azimuthal-test.js │ │ ├── bonne-test.js │ │ ├── equirectangular-test.js │ │ ├── greatArc-test.js │ │ ├── mercator-test.js │ │ └── path-test.js │ │ ├── geom │ │ └── polygon-test.js │ │ ├── layout │ │ ├── cluster-test.js │ │ ├── hierarchy-test.js │ │ ├── histogram-test.js │ │ ├── pack-test.js │ │ ├── partition-test.js │ │ ├── pie-test.js │ │ ├── tree-test.js │ │ └── treemap-test.js │ │ ├── scale │ │ ├── category-test.js │ │ ├── linear-test.js │ │ ├── log-test.js │ │ ├── ordinal-test.js │ │ ├── pow-test.js │ │ ├── quantile-test.js │ │ ├── quantize-test.js │ │ └── sqrt-test.js │ │ ├── svg │ │ ├── arc-test.js │ │ ├── area-radial-test.js │ │ ├── area-test.js │ │ ├── axis-test.js │ │ ├── line-radial-test.js │ │ ├── line-test.js │ │ └── symbol-test.js │ │ └── time │ │ ├── day-test.js │ │ ├── days-test.js │ │ ├── format-test.js │ │ ├── hour-test.js │ │ ├── hours-test.js │ │ ├── minute-test.js │ │ ├── minutes-test.js │ │ ├── month-test.js │ │ ├── months-test.js │ │ ├── scale-test.js │ │ ├── second-test.js │ │ ├── seconds-test.js │ │ ├── week-test.js │ │ ├── weeks-test.js │ │ ├── year-test.js │ │ └── years-test.js ├── dat.gui.min.js ├── globe │ ├── LICENSE │ ├── README.md │ ├── globe-search │ │ ├── embed.html │ │ ├── index.html │ │ └── search.json │ ├── globe │ │ ├── ce.png │ │ ├── globe.js │ │ ├── index.html │ │ ├── loading.gif │ │ ├── population909500.json │ │ ├── third-party │ │ │ ├── Three │ │ │ │ ├── Detector.js │ │ │ │ ├── LICENSE │ │ │ │ ├── RequestAnimationFrame.js │ │ │ │ ├── ThreeExtras.js │ │ │ │ └── ThreeWebGL.js │ │ │ └── Tween.js │ │ └── world.jpg │ └── webgl-globe.zip ├── jquery-1.7.1.min.js ├── packetloop │ ├── cube.js │ ├── files.js │ ├── main.css │ ├── multiple-timeseries.js │ └── packetloop.js └── three │ ├── Three.js │ └── Three.r40.js ├── ubigraph ├── dns.py └── ubigraph.py └── world └── world.html /.gitignore: -------------------------------------------------------------------------------- 1 | pig_*.log 2 | *.RData 3 | *.Rd2dvi* 4 | Rplots.pdf 5 | *.Rout 6 | pig.ipr 7 | pig.iws 8 | lib/packetpig/target 9 | lib/packetpig/.idea/workspace.xml 10 | *.tsv 11 | *.csv 12 | lib/packetpig/.classpath 13 | lib/packetpig/.project 14 | README.html 15 | tmp 16 | 17 | secret 18 | output 19 | *.pyc 20 | 21 | lib/elastic-mapreduce-ruby/credentials.json 22 | lib/*.tar.gz 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SRCS=$(shell find lib/packetpig/src/main/java/com/packetloop/packetpig -name '*.java') 2 | 3 | PIG_JAR=lib/packetpig.jar 4 | DEP_PIG_JAR=lib/packetpig-with-dependencies.jar 5 | 6 | all: $(PIG_JAR) spam_deletion 7 | 8 | $(PIG_JAR): $(SRCS) 9 | cd lib/packetpig && mvn compile package && cp target/packetpig-*-with-dependencies.jar ../../$(DEP_PIG_JAR) && cp target/packetpig-[0-9].[0-9]-SNAPSHOT.jar ../../$(PIG_JAR) 10 | 11 | spam_deletion: 12 | @rm -f pig_*.log 13 | 14 | clean: 15 | rm -rf lib/packetpig/target $(PIG_JAR) 16 | 17 | .PHONY: clean all spam_deletion 18 | -------------------------------------------------------------------------------- /data/web.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/data/web.pcap -------------------------------------------------------------------------------- /lib/axis-1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/axis-1.4.jar -------------------------------------------------------------------------------- /lib/commons-discovery-20040218.194635.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/commons-discovery-20040218.194635.jar -------------------------------------------------------------------------------- /lib/dnsjava-2.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/dnsjava-2.1.1.jar -------------------------------------------------------------------------------- /lib/elastic-mapreduce-ruby/amazon/coral/handler.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008-2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | 4 | module Amazon 5 | module Coral 6 | 7 | class Handler 8 | 9 | # Operate on the specified Job on the "outbound" side of the execution 10 | def before(job) 11 | end 12 | 13 | # Operation on the specified Job on the "inbound" side of the execution 14 | def after(job) 15 | end 16 | 17 | end 18 | 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/elastic-mapreduce-ruby/amazon/coral/httpdelegationhelper.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008-2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | 4 | module Amazon 5 | module Coral 6 | 7 | class HttpDelegationHelper 8 | def self.add_delegation_token(delegate_identity, request_identity) 9 | token = "" 10 | first = true 11 | 12 | delegate_identity.each do |k,v| 13 | if(first) 14 | first = false 15 | else 16 | token << ';' 17 | end 18 | 19 | token << "#{k}=#{v}" 20 | end 21 | 22 | request_identity[:http_delegation] = token if(token.length > 0) 23 | end 24 | end 25 | 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/elastic-mapreduce-ruby/amazon/coral/job.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008-2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | 4 | module Amazon 5 | module Coral 6 | 7 | class Job 8 | def initialize(request) 9 | @request = request 10 | @reply = {} 11 | end 12 | 13 | # Returns the hash of request attributes 14 | def request 15 | @request 16 | end 17 | 18 | # Returns the hash of reply attributes 19 | def reply 20 | @reply 21 | end 22 | end 23 | 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /lib/elastic-mapreduce-ruby/amazon/coral/logfactory.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008-2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | 4 | require 'logger' 5 | 6 | module Amazon 7 | module Coral 8 | 9 | # A simple log retrieval interface to allow injection of common logging frameworks. 10 | class LogFactory 11 | 12 | @@instance = LogFactory.new 13 | 14 | # Invokes the singleton LogFactory instance to retrieve a logger for a given key. 15 | def LogFactory.getLog(key) 16 | return @@instance.getLog(key) 17 | end 18 | 19 | # Specifies a LogFactory instance which will handle log requests. 20 | # Call this method early in execution prior to instantiating handlers to replace the default no-op log. 21 | def LogFactory.setInstance(instance) 22 | @@instance = instance 23 | end 24 | 25 | # Default logging implementation which returns a null logger. 26 | def getLog(key) 27 | log = Logger.new(nil) 28 | log.level = Logger::FATAL 29 | return log 30 | end 31 | 32 | end 33 | 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /lib/elastic-mapreduce-ruby/amazon/coral/urlencoding.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008-2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | require 'cgi' 4 | 5 | module Amazon 6 | module Coral 7 | 8 | # Performs AWS's preferred method of URLEncoding. 9 | class UrlEncoding 10 | 11 | # Convert a string into URL encoded form. 12 | def UrlEncoding.encode(plaintext) 13 | CGI.escape(plaintext.to_s).gsub("+", "%20").gsub("%7E", "~") 14 | end 15 | end 16 | 17 | end 18 | end 19 | 20 | -------------------------------------------------------------------------------- /lib/elastic-mapreduce-ruby/amazon/coral/v1signaturehandler.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008-2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | 4 | require 'openssl' 5 | require 'base64' 6 | require 'time' 7 | require 'amazon/coral/handler' 8 | require 'amazon/coral/v1signaturehelper' 9 | 10 | module Amazon 11 | module Coral 12 | 13 | # Applies an AWS version 1 signature to the outgoing request. 14 | class V1SignatureHandler < Handler 15 | 16 | def before(job) 17 | request = job.request 18 | identity = request[:identity] 19 | aws_access_key = identity[:aws_access_key] 20 | aws_secret_key = identity[:aws_secret_key] 21 | 22 | query_string_map = request[:query_string_map] 23 | 24 | return if aws_access_key.nil? || aws_secret_key.nil? || query_string_map.nil?; 25 | 26 | V1SignatureHelper.new(aws_access_key, aws_secret_key).sign({:query_string_map => query_string_map}) 27 | end 28 | 29 | end 30 | 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/elastic-mapreduce-ruby/amazon/stderr_logger.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008-2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | 4 | module Amazon 5 | class StdErrLogger 6 | INFO = { :level => 4, :string => "INFO" } 7 | 8 | def initialize(level=nil) 9 | @level = level || INFO[:level] 10 | @file = STDERR 11 | end 12 | 13 | def message(level, msg) 14 | if level[:level] <= @level then 15 | @file.puts(level[:string] + " " + msg) 16 | end 17 | end 18 | 19 | def info(*args) 20 | message(INFO, *args) 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/elastic-mapreduce-ruby/elastic-mapreduce: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # Copyright 2008-2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | 5 | $LOAD_PATH.unshift File.dirname(__FILE__) 6 | require 'elastic-mapreduce-cli' 7 | -------------------------------------------------------------------------------- /lib/elastic-mapreduce-ruby/elastic-mapreduce-cli.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # Copyright 2008-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | 5 | require 'commands' 6 | require 'simple_logger' 7 | require 'simple_executor' 8 | 9 | exit_code = 0 10 | begin 11 | logger = SimpleLogger.new 12 | executor = SimpleExecutor.new 13 | commands = Commands::create_and_execute_commands( 14 | ARGV, Amazon::Coral::ElasticMapReduceClient, logger, executor 15 | ) 16 | rescue SystemExit => e 17 | exit_code = -1 18 | rescue Exception => e 19 | STDERR.puts("Error: " + e.message) 20 | STDERR.puts(e.backtrace.join("\n")) 21 | exit_code = -1 22 | end 23 | 24 | exit(exit_code) 25 | -------------------------------------------------------------------------------- /lib/elastic-mapreduce-ruby/run_tests.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008-2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | 4 | $LOAD_PATH << File.dirname(__FILE__) 5 | 6 | require 'tests/commands_test' 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/elastic-mapreduce-ruby/samples/wordSplitter.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import sys 4 | import re 5 | 6 | def main(argv): 7 | line = sys.stdin.readline() 8 | pattern = re.compile("[a-zA-Z][a-zA-Z0-9]*") 9 | try: 10 | while line: 11 | for word in pattern.findall(line): 12 | print "LongValueSum:" + word.lower() + "\t" + "1" 13 | line = sys.stdin.readline() 14 | except "end of file": 15 | return None 16 | if __name__ == "__main__": 17 | main(sys.argv) 18 | 19 | -------------------------------------------------------------------------------- /lib/elastic-mapreduce-ruby/simple_executor.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008-2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | 4 | class SimpleExecutor 5 | def exec(cmd) 6 | puts(cmd) 7 | if ! system(cmd) then 8 | raise RuntimeError, "Command failed." 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/elastic-mapreduce-ruby/simple_logger.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008-2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | 4 | class SimpleLogger 5 | attr_accessor :level 6 | 7 | def initialize 8 | @level = :info 9 | end 10 | 11 | def puts(msg) 12 | STDOUT.puts msg 13 | end 14 | 15 | def trace(msg) 16 | if [:debug, :trace].include?(level) then 17 | STDOUT.puts "#{Time.now.utc} TRACE " + msg 18 | end 19 | end 20 | 21 | def info(msg) 22 | if [:debug, :trace, :info].include?(level) then 23 | STDOUT.puts "#{Time.now.utc} INFO " + msg 24 | end 25 | end 26 | 27 | def error(msg) 28 | if [:debug, :trace, :info, :error].include?(level) then 29 | STDOUT.puts "#{Time.now.utc} ERROR " + msg 30 | end 31 | end 32 | 33 | def fatal(msg) 34 | if [:debug, :trace, :info, :error, :fatal].include?(level) then 35 | STDOUT.puts "#{Time.now.utc} FATAL " + msg 36 | end 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /lib/elastic-mapreduce-ruby/tests/credentials.json: -------------------------------------------------------------------------------- 1 | { 2 | "access-id": "ACCESSID", 3 | "private-key": "PRIVATEKEY", 4 | "key-pair": "test-keypair-name", 5 | "key-pair-file": "tests/keypair-file", 6 | "log-uri": "s3://test-bucket/logs/" 7 | } 8 | -------------------------------------------------------------------------------- /lib/elastic-mapreduce-ruby/tests/example.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "Example Step", 4 | "ActionOnFailure": "CONTINUE", 5 | "HadoopJarStep": { 6 | "Jar": "/home/hadoop/contrib/streaming/hadoop-0.18-streaming.jar", 7 | "Args": [ 8 | "-input", "s3n://elasticmapreduce/samples/wordcount/input", 9 | "-output", "s3n:///result", 10 | "-mapper", "s3:///lib/mapper" 11 | ] 12 | } 13 | } 14 | ] -------------------------------------------------------------------------------- /lib/kraken-pcap-1.6.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/kraken-pcap-1.6.0.jar -------------------------------------------------------------------------------- /lib/mongo-2.9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/mongo-2.9.0.jar -------------------------------------------------------------------------------- /lib/mongo-hadoop-core-1.1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/mongo-hadoop-core-1.1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /lib/mongo-hadoop-pig-1.1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/mongo-hadoop-pig-1.1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /lib/packetpig-with-dependencies.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/packetpig-with-dependencies.jar -------------------------------------------------------------------------------- /lib/packetpig.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/packetpig.jar -------------------------------------------------------------------------------- /lib/packetpig/.idea/.name: -------------------------------------------------------------------------------- 1 | packetpig -------------------------------------------------------------------------------- /lib/packetpig/.idea/codeStyleSettings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__ant_ant_1_6_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__asm_asm_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__com_thoughtworks_paranamer_paranamer_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__com_thoughtworks_paranamer_paranamer_ant_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__com_thoughtworks_paranamer_paranamer_generator_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__com_thoughtworks_qdox_qdox_1_10_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_7_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__commons_beanutils_commons_beanutils_core_1_8_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__commons_cli_commons_cli_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__commons_codec_commons_codec_1_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__commons_collections_commons_collections_3_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__commons_configuration_commons_configuration_1_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__commons_digester_commons_digester_1_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__commons_discovery_commons_discovery_20040218_194635.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__commons_el_commons_el_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__commons_httpclient_commons_httpclient_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__commons_lang_commons_lang_2_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__commons_logging_commons_logging_1_0_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__commons_net_commons_net_1_4_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__dnsjava_dnsjava_2_0_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__hsqldb_hsqldb_1_8_0_10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__junit_junit_4_8_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__net_java_dev_jets3t_jets3t_0_7_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__net_sf_kosmosfs_kfs_0_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_apache_axis_axis_1_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_apache_commons_commons_math_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_apache_hadoop_avro_1_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_apache_hadoop_hadoop_core_1_0_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_apache_pig_pig_0_9_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_codehaus_jackson_jackson_core_asl_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_codehaus_jackson_jackson_mapper_asl_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_eclipse_jdt_core_3_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_krakenapps_kraken_api_1_6_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_krakenapps_kraken_pcap_1_6_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_mortbay_jetty_jetty_6_1_26.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_mortbay_jetty_jetty_util_6_1_26.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_mortbay_jetty_jsp_2_1_6_1_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_mortbay_jetty_jsp_api_2_1_6_1_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_mortbay_jetty_servlet_api_2_5_20081211.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_mortbay_jetty_servlet_api_2_5_6_1_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_slf4j_slf4j_api_1_6_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__org_slf4j_slf4j_simple_1_5_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__oro_oro_2_0_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__tomcat_jasper_compiler_5_5_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__tomcat_jasper_runtime_5_5_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/libraries/Maven__xmlenc_xmlenc_0_52.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /lib/packetpig/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/packetpig/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | packetpig 4 | NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. 5 | 6 | 7 | 8 | org.eclipse.jdt.core.javabuilder 9 | 10 | 11 | 12 | org.eclipse.jdt.core.javanature 13 | 14 | -------------------------------------------------------------------------------- /lib/packetpig/src/main/java/com/maxmind/geoip/Region.java: -------------------------------------------------------------------------------- 1 | package com.maxmind.geoip; 2 | 3 | public class Region{ 4 | public String countryCode; 5 | public String countryName; 6 | public String region; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /lib/packetpig/src/main/java/com/packetloop/packetpig/loaders/pcap/PcapInputFormat.java: -------------------------------------------------------------------------------- 1 | package com.packetloop.packetpig.loaders.pcap; 2 | 3 | import org.apache.hadoop.mapreduce.InputSplit; 4 | import org.apache.hadoop.mapreduce.RecordReader; 5 | import org.apache.hadoop.mapreduce.TaskAttemptContext; 6 | import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; 7 | 8 | import java.io.IOException; 9 | 10 | public class PcapInputFormat extends FileInputFormat { 11 | // TODO split on tcp conversation boundary 12 | @Override 13 | public RecordReader createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { 14 | return null; 15 | //return new PcapRecordReader(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/packetpig/src/main/java/com/packetloop/packetpig/loaders/pcap/StreamSink.java: -------------------------------------------------------------------------------- 1 | package com.packetloop.packetpig.loaders.pcap; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | 6 | public class StreamSink implements Runnable { 7 | private InputStream stream; 8 | 9 | public StreamSink(InputStream stream) { 10 | this.stream = stream; 11 | } 12 | 13 | @Override 14 | public void run() { 15 | while (true) { 16 | try { 17 | byte[] msg = new byte[stream.available()]; 18 | stream.read(msg); 19 | if (msg.length > 0) { 20 | System.err.print(new String(msg)); 21 | } 22 | } catch (IOException ignored) { 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/packetpig/src/main/java/com/packetloop/packetpig/loaders/pcap/detection/FingerprintLoader.java: -------------------------------------------------------------------------------- 1 | package com.packetloop.packetpig.loaders.pcap.detection; 2 | 3 | import com.packetloop.packetpig.loaders.pcap.PcapLoader; 4 | import org.apache.hadoop.mapreduce.InputFormat; 5 | import org.apache.hadoop.mapreduce.InputSplit; 6 | import org.apache.hadoop.mapreduce.RecordReader; 7 | import org.apache.hadoop.mapreduce.TaskAttemptContext; 8 | import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; 9 | 10 | import java.io.IOException; 11 | 12 | public class FingerprintLoader extends PcapLoader { 13 | @Override 14 | public InputFormat getInputFormat() throws IOException { 15 | return new FileInputFormat() { 16 | @Override 17 | public RecordReader createRecordReader(InputSplit split, TaskAttemptContext context) { 18 | return new FingerprintRecordReader(); 19 | } 20 | }; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/packetpig/src/main/java/com/packetloop/packetpig/loaders/pcap/packet/DnsAllPacketLoader.java: -------------------------------------------------------------------------------- 1 | package com.packetloop.packetpig.loaders.pcap.packet; 2 | 3 | import com.packetloop.packetpig.loaders.pcap.PcapLoader; 4 | import org.apache.hadoop.mapreduce.InputFormat; 5 | import org.apache.hadoop.mapreduce.InputSplit; 6 | import org.apache.hadoop.mapreduce.RecordReader; 7 | import org.apache.hadoop.mapreduce.TaskAttemptContext; 8 | import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; 9 | import org.apache.pig.data.Tuple; 10 | 11 | import java.io.IOException; 12 | 13 | public class DnsAllPacketLoader extends PcapLoader { 14 | 15 | @Override 16 | public InputFormat getInputFormat() throws IOException { 17 | return new FileInputFormat() { 18 | @Override 19 | public RecordReader createRecordReader(InputSplit split, TaskAttemptContext context) { 20 | return new DnsPacketAllRecordReader(); 21 | } 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/packetpig/src/main/java/com/packetloop/packetpig/loaders/pcap/packet/DnsPacketLoader.java: -------------------------------------------------------------------------------- 1 | package com.packetloop.packetpig.loaders.pcap.packet; 2 | 3 | import com.packetloop.packetpig.loaders.pcap.PcapLoader; 4 | import org.apache.hadoop.mapreduce.InputFormat; 5 | import org.apache.hadoop.mapreduce.InputSplit; 6 | import org.apache.hadoop.mapreduce.RecordReader; 7 | import org.apache.hadoop.mapreduce.TaskAttemptContext; 8 | import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; 9 | import org.apache.pig.data.Tuple; 10 | 11 | import java.io.IOException; 12 | 13 | public class DnsPacketLoader extends PcapLoader { 14 | 15 | @Override 16 | public InputFormat getInputFormat() throws IOException { 17 | return new FileInputFormat() { 18 | @Override 19 | public RecordReader createRecordReader(InputSplit split, TaskAttemptContext context) { 20 | return new DnsPacketRecordReader(); 21 | } 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/packetpig/src/main/java/com/packetloop/packetpig/loaders/pcap/packet/PacketLoader.java: -------------------------------------------------------------------------------- 1 | package com.packetloop.packetpig.loaders.pcap.packet; 2 | 3 | import com.packetloop.packetpig.loaders.pcap.PcapLoader; 4 | import org.apache.hadoop.mapreduce.InputFormat; 5 | import org.apache.hadoop.mapreduce.InputSplit; 6 | import org.apache.hadoop.mapreduce.RecordReader; 7 | import org.apache.hadoop.mapreduce.TaskAttemptContext; 8 | import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; 9 | import org.apache.pig.data.Tuple; 10 | 11 | import java.io.IOException; 12 | 13 | public class PacketLoader extends PcapLoader { 14 | @Override 15 | public InputFormat getInputFormat() throws IOException { 16 | return new FileInputFormat() { 17 | @Override 18 | public RecordReader createRecordReader(InputSplit split, TaskAttemptContext context) { 19 | return new PacketRecordReader(); 20 | } 21 | }; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/packetpig/src/main/java/com/packetloop/packetpig/udf/geoip/ASNum.java: -------------------------------------------------------------------------------- 1 | package com.packetloop.packetpig.udf.geoip; 2 | 3 | import com.maxmind.geoip.LookupService; 4 | import org.apache.pig.EvalFunc; 5 | import org.apache.pig.backend.executionengine.ExecException; 6 | import org.apache.pig.data.Tuple; 7 | 8 | import java.io.FileNotFoundException; 9 | import java.io.IOException; 10 | 11 | public class ASNum extends EvalFunc { 12 | 13 | private LookupService cl; 14 | 15 | public ASNum() throws IOException { 16 | try { 17 | cl = new LookupService("data/GeoIPASNum.dat", LookupService.GEOIP_MEMORY_CACHE); 18 | } catch (FileNotFoundException ignored) { 19 | cl = new LookupService("GeoIPASNum.dat", LookupService.GEOIP_MEMORY_CACHE); 20 | } 21 | } 22 | 23 | @Override 24 | public String exec(Tuple input) throws ExecException { 25 | return cl.getOrg((String)input.get(0)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/packetpig/src/main/java/com/packetloop/packetpig/udf/util/Explode.java: -------------------------------------------------------------------------------- 1 | package com.packetloop.packetpig.udf.util; 2 | 3 | import org.apache.pig.EvalFunc; 4 | import org.apache.pig.data.DataBag; 5 | import org.apache.pig.data.DefaultDataBag; 6 | import org.apache.pig.data.Tuple; 7 | import org.apache.pig.data.TupleFactory; 8 | 9 | import java.io.IOException; 10 | 11 | public class Explode extends EvalFunc { 12 | @Override 13 | public DataBag exec(Tuple input) throws IOException { 14 | DataBag data = new DefaultDataBag(); 15 | for (Object t_obj : input.getAll()) { 16 | Tuple tuple = (Tuple)t_obj; 17 | 18 | for (Object obj : tuple.getAll()) { 19 | Tuple t = TupleFactory.getInstance().newTuple(); 20 | t.append(obj); 21 | data.add(t); 22 | } 23 | } 24 | 25 | return data; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/packetpig/src/test/java/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/packetpig/src/test/java/.gitkeep -------------------------------------------------------------------------------- /lib/piggybank.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/piggybank.jar -------------------------------------------------------------------------------- /lib/scripts/country_finder.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | require 'geoip' 3 | require 'logger' 4 | 5 | #log = Logger.new('log.txt') 6 | 7 | STDIN.each_line do |line| 8 | packet = line.split(' ') 9 | # log.debug line.to_s 10 | # log.debug "The number of vars is #{packet.size}" 11 | country = GeoIP.new('../data/GeoIP.dat').country(packet[13]) 12 | puts country[4].to_s 13 | end 14 | -------------------------------------------------------------------------------- /lib/scripts/impacket/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include MANIFEST.in 2 | include LICENSE 3 | include ChangeLog 4 | recursive-include examples *.txt *.py 5 | -------------------------------------------------------------------------------- /lib/scripts/impacket/examples/ms05-039-crash.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from exploit import DCERPCExploit 3 | from impacket.structure import Structure 4 | 5 | class PNP_QueryResConfList(Structure): 6 | alignment = 4 7 | structure = ( 8 | ('treeRoot', 'w'), 9 | ('resourceType',' [user] [password]" % sys.argv[0] 7 | sys.exit(1) 8 | 9 | host = sys.argv[1] 10 | shre = sys.argv[2] 11 | file = sys.argv[3] 12 | user = '' 13 | passwd = '' 14 | try: 15 | user = sys.argv[4] 16 | passwd = sys.argv[5] 17 | except: 18 | pass 19 | 20 | s = smb.SMB('*SMBSERVER',host) 21 | s.login(user, passwd) 22 | tid = s.tree_connect_andx(r"\\*SMBSERVER\%s" % shre) 23 | fid = s.open_file(tid, file, smb.SMB_O_OPEN, smb.SMB_ACCESS_READ)[0] 24 | offset = 0 25 | while 1: 26 | data = s.read_andx(tid, fid, offset, 40000) 27 | sys.stdout.write(data) 28 | if len(data) == 0: break 29 | offset += len(data) 30 | 31 | s.close_file(tid, fid) 32 | 33 | -------------------------------------------------------------------------------- /lib/scripts/impacket/examples/smbrelayx/creds.txt: -------------------------------------------------------------------------------- 1 | nobody:WORKGROUP:LMHASH:NTHASH 2 | -------------------------------------------------------------------------------- /lib/scripts/impacket/examples/smbrelayx/smb.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | # These are all mandatory 3 | # The log parsing is pretty simple.. that's the reason :P 4 | server_name = CACHO 5 | server_os = Unix 6 | server_domain = BETOLAND 7 | credentials_file = creds.txt 8 | log_file = smb.log 9 | 10 | # Shares, just put a tag, and that's a share. 11 | # All share names MUST be set in upper case 12 | # Beware of that 13 | # Types: 0 = Disk 14 | # 1 = Printer 15 | # 3 = IPC 16 | [TMP] 17 | comment = tmp share 18 | read only = no 19 | share type = 0 20 | path = /tmp/shared 21 | 22 | [ADMIN$] 23 | comment = tmp share 24 | read only = no 25 | share type = 0 26 | path = /tmp/shared 27 | 28 | # Mandatory! Otherwise no shares will work 29 | [IPC$] 30 | comment = IPC$ common share 31 | read only = yes 32 | path = NONE 33 | share type = 3 34 | 35 | -------------------------------------------------------------------------------- /lib/scripts/impacket/examples/smbserver/creds.txt: -------------------------------------------------------------------------------- 1 | nobody:WORKGROUP:LMHASH:NTHASH 2 | -------------------------------------------------------------------------------- /lib/scripts/impacket/examples/smbserver/simple_server.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # Copyright (c) 2003-2011 CORE Security Technologies 3 | # 4 | # This software is provided under under a slightly modified version 5 | # of the Apache Software License. See the accompanying LICENSE file 6 | # for more information. 7 | # 8 | # $Id: sniff.py 17 2003-10-27 17:36:57Z jkohen $ 9 | # 10 | # Simple SMB Server, check smb.conf for details 11 | # 12 | # Author: 13 | # Alberto Solino 14 | # 15 | 16 | from impacket import smbserver 17 | 18 | server = smbserver.SMBSERVER(('0.0.0.0',445)) 19 | server.processConfigFile('smb.conf') 20 | server.serve_forever() 21 | -------------------------------------------------------------------------------- /lib/scripts/impacket/examples/smbserver/smb.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | # These are all mandatory 3 | # The log parsing is pretty simple.. that's the reason :P 4 | server_name = CACHO 5 | server_os = Unix 6 | server_domain = BETOLAND 7 | # Still not used 8 | credentials_file = creds.txt 9 | log_file = smb.log 10 | 11 | # Shares, just put a tag, and that's a share. 12 | # All share names MUST be set in upper case 13 | # Beware of that 14 | # Types: 0 = Disk 15 | # 1 = Printer 16 | # 3 = IPC 17 | [TMP] 18 | comment = tmp share 19 | read only = no 20 | share type = 0 21 | path = /tmp/shared 22 | 23 | # Mandatory! Otherwise no shares will work 24 | [IPC$] 25 | comment = IPC$ common share 26 | read only = yes 27 | path = NONE 28 | share type = 3 29 | 30 | -------------------------------------------------------------------------------- /lib/scripts/impacket/impacket/__init__.py: -------------------------------------------------------------------------------- 1 | pass 2 | -------------------------------------------------------------------------------- /lib/scripts/impacket/impacket/dcerpc/__init__.py: -------------------------------------------------------------------------------- 1 | pass 2 | -------------------------------------------------------------------------------- /lib/scripts/impacket/impacket/testcases/ImpactPacket/runalltestcases.bat: -------------------------------------------------------------------------------- 1 | 2 | FOR /f "tokens=*" %%G IN ('dir /B *.py') DO %%G -------------------------------------------------------------------------------- /lib/scripts/impacket/impacket/testcases/ImpactPacket/runalltestcases.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | separator='======================================================================' 3 | #ls *.py | xargs -I{} --max-args=1 bash -c "echo -e '$separator\nExecuting: {}\n';python {}" 4 | #ls *.py | xargs --max-args=1 python 5 | 6 | 7 | total=0 8 | ok=0 9 | failed=0 10 | for file in `ls *.py` ; do 11 | echo $separator 12 | echo Executing $file 13 | latest=$( 14 | python $file 2>&1 | { 15 | while read line; do 16 | echo " $line" 1>&2 17 | latest="$line" 18 | done 19 | echo $latest 20 | } 21 | ) 22 | #echo Latest ${latest} 23 | result=${latest:0:6} 24 | if [ "$result" = "FAILED" ] 25 | then 26 | (( failed++ )) 27 | elif [ "$result" = "OK" ] 28 | then 29 | (( ok++ )) 30 | else 31 | echo "WARNING: Unknown result!!!!!" 32 | (( failed++ )) 33 | fi 34 | 35 | (( total++ )) 36 | done 37 | echo $separator 38 | echo Summary: 39 | echo " OK $ok/$total" 40 | echo " $failed FAILED" 41 | -------------------------------------------------------------------------------- /lib/scripts/impacket/impacket/testcases/dot11/runalltestcases.bat: -------------------------------------------------------------------------------- 1 | 2 | FOR /f "tokens=*" %%G IN ('dir /B *.py') DO %%G -------------------------------------------------------------------------------- /lib/scripts/impacket/impacket/testcases/dot11/runalltestcases.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | separator='======================================================================' 3 | #ls *.py | xargs -I{} --max-args=1 bash -c "echo -e '$separator\nExecuting: {}\n';python {}" 4 | #ls *.py | xargs --max-args=1 python 5 | 6 | 7 | total=0 8 | ok=0 9 | failed=0 10 | for file in `ls *.py` ; do 11 | echo $separator 12 | echo Executing $file 13 | latest=$( 14 | python $file 2>&1 | { 15 | while read line; do 16 | echo " $line" 1>&2 17 | latest="$line" 18 | done 19 | echo $latest 20 | } 21 | ) 22 | #echo Latest ${latest} 23 | result=${latest:0:6} 24 | if [ "$result" = "FAILED" ] 25 | then 26 | (( failed++ )) 27 | elif [ "$result" = "OK" ] 28 | then 29 | (( ok++ )) 30 | else 31 | echo "WARNING: Unknown result!!!!!" 32 | (( failed++ )) 33 | fi 34 | 35 | (( total++ )) 36 | done 37 | echo $separator 38 | echo Summary: 39 | echo " OK $ok/$total" 40 | echo " $failed FAILED" 41 | -------------------------------------------------------------------------------- /lib/scripts/impacket/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # $Id: setup.py 256 2011-06-08 02:37:58Z gmoreira $ 3 | 4 | import glob 5 | import os 6 | 7 | from distutils.core import setup 8 | 9 | PACKAGE_NAME = "Impacket" 10 | 11 | setup(name = PACKAGE_NAME, 12 | version = "0.9.7.0", 13 | description = "Network protocols Constructors and Dissectors", 14 | url = "http://oss.coresecurity.com/projects/impacket.html", 15 | author = "CORE Security Technologies", 16 | author_email = "oss@coresecurity.com", 17 | maintainer = "Gustavo Moreira", 18 | maintainer_email = "gmoreira@gmail.com", 19 | packages = ['impacket', 'impacket.dcerpc'], 20 | scripts = glob.glob(os.path.join('examples', '*.py')), 21 | data_files = [(os.path.join('share', 'doc', PACKAGE_NAME), 22 | ['README', 'LICENSE']+glob.glob('doc/*'))], 23 | ) 24 | -------------------------------------------------------------------------------- /lib/scripts/readme.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import markdown 4 | 5 | html = markdown.markdown(open('README.md').read()) 6 | open('README.html', 'wb').write(html) 7 | 8 | -------------------------------------------------------------------------------- /lib/slf4j-api-1.6.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/slf4j-api-1.6.4.jar -------------------------------------------------------------------------------- /lib/src/Python-2.7.2.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/src/Python-2.7.2.tar.bz2 -------------------------------------------------------------------------------- /lib/src/daq-1.1.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/src/daq-1.1.1.tar.gz -------------------------------------------------------------------------------- /lib/src/libdnet-1.12.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/src/libdnet-1.12.tgz -------------------------------------------------------------------------------- /lib/src/libpcap-1.3.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/src/libpcap-1.3.0.tar.gz -------------------------------------------------------------------------------- /lib/src/pynids-0.6.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/src/pynids-0.6.1.tar.gz -------------------------------------------------------------------------------- /lib/src/scapy-latest.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/src/scapy-latest.tar.gz -------------------------------------------------------------------------------- /lib/src/snort-2.9.3.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/lib/src/snort-2.9.3.1.tar.gz -------------------------------------------------------------------------------- /lib/tailer: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | trap('SIGINT') do 4 | exit! 5 | end 6 | 7 | paths = ARGV 8 | tails = {} 9 | 10 | t = Thread.new do 11 | while true 12 | paths.each do |path| 13 | Dir[path].each do |file| 14 | tails[file] ||= begin 15 | fork do 16 | exec "tail -f #{file}" 17 | end 18 | end 19 | end 20 | end 21 | 22 | sleep 1 23 | end 24 | end 25 | 26 | t.join 27 | -------------------------------------------------------------------------------- /packetpig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/packetpig.png -------------------------------------------------------------------------------- /pig.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$PREFIX" = "" ]; then 4 | prefix=packetpig 5 | else 6 | prefix=$PREFIX 7 | fi 8 | 9 | SCP=$(which scp) 10 | 11 | abs_path() 12 | { 13 | perl -MCwd -e "print Cwd::abs_path('$1');" 14 | } 15 | 16 | hdfs() 17 | { 18 | file=file://$(abs_path $1) 19 | dest=hdfs://$HDFS_MASTER/$prefix/$(basename $1) 20 | 21 | echo $file -\> $dest 22 | 23 | cmd="hadoop fs -cp $file $dest" 24 | $($cmd 2>/dev/null) 25 | 26 | if [ $? -ne 0 ]; then 27 | echo "error: $cmd" 28 | fi 29 | } 30 | 31 | -------------------------------------------------------------------------------- /pig/choropleth/choropleth-snort.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | %DEFAULT snortconfig 'lib/snort/etc/snort.conf' 5 | 6 | snort_alerts = LOAD '$pcap' 7 | USING com.packetloop.packetpig.loaders.pcap.detection.SnortLoader('$snortconfig') 8 | AS ( 9 | ts:long, 10 | sig:chararray, 11 | priority:int, 12 | message:chararray, 13 | proto:chararray, 14 | src:chararray, 15 | sport:int, 16 | dst:chararray, 17 | dport:int 18 | ); 19 | 20 | countries = FOREACH snort_alerts 21 | GENERATE 22 | com.packetloop.packetpig.udf.geoip.Country(src) as country, 23 | priority; 24 | 25 | countries = GROUP countries 26 | BY country; 27 | 28 | countries = FOREACH countries 29 | GENERATE 30 | group, 31 | AVG(countries.priority) as average_severity; 32 | 33 | STORE countries into 'output/choropleth_countries' using PigStorage(','); 34 | 35 | -------------------------------------------------------------------------------- /pig/cube/cube-ngram.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | %DEFAULT filter '' 5 | %DEFAULT n '3' 6 | 7 | ngram = LOAD '$pcap' 8 | USING com.packetloop.packetpig.loaders.pcap.packet.PacketNgramLoader('$filter', '$n'); 9 | 10 | STORE ngram INTO 'output/cube-ngram' using PigStorage(','); 11 | 12 | -------------------------------------------------------------------------------- /pig/examples/basic_http.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | %DEFAULT time 60 5 | --%DEFAULT field 'etag' 6 | --%DEFAULT field 'referer' 7 | %DEFAULT field 'user-agent' 8 | --%DEFAULT field 'set-cookie' 9 | 10 | http_conversations = LOAD '$pcap' USING com.packetloop.packetpig.loaders.pcap.protocol.HTTPConversationLoader('$field') AS ( 11 | ts:long, 12 | src:chararray, 13 | sport:int, 14 | dst:chararray, 15 | dport:int, 16 | field:chararray 17 | ); 18 | 19 | DUMP http_conversations; 20 | -------------------------------------------------------------------------------- /pig/examples/basic_snort.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | %DEFAULT snortconfig 'lib/snort/etc/snort.conf' 5 | 6 | snort_alerts = 7 | LOAD '$pcap' 8 | USING com.packetloop.packetpig.loaders.pcap.detection.SnortLoader('$snortconfig') 9 | AS (ts:long, sig:chararray, priority:int, message:chararray, proto:chararray, 10 | src:chararray, dst:chararray, sport:int, dport:int); 11 | 12 | DUMP snort_alerts; 13 | -------------------------------------------------------------------------------- /pig/examples/conversation_info.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | %DEFAULT tcppath 'lib/scripts/tcp.py' 5 | 6 | conversations = LOAD '$pcap' USING com.packetloop.packetpig.loaders.pcap.conversation.ConversationLoader('$tcppath') AS 7 | ( 8 | ts:long, 9 | src:chararray, 10 | sport:int, 11 | dst:chararray, 12 | dport:int, 13 | end_state:chararray, 14 | timestamps, 15 | intervals 16 | ); 17 | 18 | STORE conversations INTO '$output/conversation_info'; 19 | -------------------------------------------------------------------------------- /pig/examples/dns.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | %DEFAULT dnspath 'lib/scripts/dns_parser.py' 5 | 6 | dns = LOAD '$pcap' USING com.packetloop.packetpig.loaders.pcap.protocol.DNSConversationLoader('$dnspath') AS ( 7 | ts:long, 8 | id:long, 9 | mode:chararray, 10 | name:chararray, 11 | addr:chararray, 12 | ttl:int 13 | ); 14 | 15 | DUMP dns; 16 | --STORE dns INTO '$output/dns' USING PigStorage(','); 17 | 18 | -------------------------------------------------------------------------------- /pig/examples/dns_all.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | dns = LOAD '$pcap' USING com.packetloop.packetpig.loaders.pcap.packet.DnsAllPacketLoader() AS ( 5 | ts:long, 6 | id:long, 7 | mode:chararray, 8 | name:chararray, 9 | addr:chararray, 10 | ttl:int, 11 | srcIP:chararray, 12 | dstIP:chararray, 13 | class:int, 14 | type:int 15 | ); 16 | 17 | DUMP dns; 18 | --STORE dns INTO '$output/dns' USING PigStorage(','); 19 | 20 | -------------------------------------------------------------------------------- /pig/examples/dns_java.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | dns = LOAD '$pcap' USING com.packetloop.packetpig.loaders.pcap.packet.DnsPacketLoader() AS ( 5 | ts:long, 6 | id:long, 7 | mode:chararray, 8 | name:chararray, 9 | addr:chararray, 10 | ttl:int 11 | ); 12 | 13 | DUMP dns; 14 | --STORE dns INTO '$output/dns' USING PigStorage(','); 15 | 16 | -------------------------------------------------------------------------------- /pig/examples/dns_response_ttl.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | %DEFAULT dnspath 'lib/scripts/dns_parser.py' 5 | 6 | dns = LOAD '$pcap' USING com.packetloop.packetpig.loaders.pcap.protocol.DNSConversationLoader('$dnspath') AS ( 7 | ts:long, 8 | id:long, 9 | mode:chararray, 10 | name:chararray, 11 | addr:chararray, 12 | ttl:int 13 | ); 14 | 15 | response = FILTER dns BY mode == 'response' AND ttl > 0; 16 | 17 | -- Output domain, ttl and the number of times seen. The key is domain/ttl. 18 | domain_grouped = GROUP response BY (name,ttl); 19 | 20 | cnt_by_ttl = FOREACH domain_grouped GENERATE FLATTEN(group), COUNT(response); 21 | 22 | STORE cnt_by_ttl INTO '$output/dns_response_ttl' USING PigStorage(','); 23 | 24 | -- Check r/examples/dns_ttl.r for plots 25 | -------------------------------------------------------------------------------- /pig/examples/extract_files.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | %DEFAULT tcppath 'lib/scripts/tcp.py' 5 | %DEFAULT path 'tmp' 6 | %DEFAULT mime '' 7 | 8 | streams = 9 | LOAD '$pcap' 10 | USING com.packetloop.packetpig.loaders.pcap.file.ConversationFileLoader('$tcppath', '$path', '$mime') 11 | AS ( 12 | ts, 13 | src:chararray, 14 | sport:int, 15 | dst:chararray, 16 | dport:int, 17 | filetype:chararray, 18 | mimetype:chararray, 19 | ext:chararray, 20 | md5:chararray, 21 | sha1:chararray, 22 | sha256:chararray, 23 | size:long, 24 | path:chararray, 25 | name:chararray 26 | ); 27 | 28 | STORE streams INTO '$output/extract_files'; 29 | -------------------------------------------------------------------------------- /pig/examples/http.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | %DEFAULT time 60 5 | %DEFAULT field '' 6 | %DEFAULT tcppath 'lib/scripts/tcp.py' 7 | 8 | http = LOAD '$pcap' USING com.packetloop.packetpig.loaders.pcap.protocol.HTTPConversationLoader('$field', '$tcppath') AS ( 9 | ts:long, 10 | src:chararray, 11 | sport:int, 12 | dst:chararray, 13 | dport:int, 14 | request:chararray, 15 | fields:tuple() 16 | ); 17 | 18 | STORE http INTO '$output/http'; 19 | 20 | -------------------------------------------------------------------------------- /pig/examples/ngram.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | %DEFAULT filter '' 5 | %DEFAULT n '1' 6 | 7 | ngram = LOAD '$pcap' 8 | USING com.packetloop.packetpig.loaders.pcap.packet.PacketNgramLoader('$filter', '$n'); 9 | 10 | STORE ngram INTO '$output/ngram' using PigStorage(','); 11 | --DUMP ngram; 12 | 13 | -- plot(x=data$V3, y=data$V4, type='h') 14 | -- plot(sort(data$V4, decreasing=TRUE), type='h') 15 | -------------------------------------------------------------------------------- /pig/examples/p0f.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | %DEFAULT snortconfig 'lib/snort/etc/snort.conf' 5 | 6 | snort_alerts = LOAD '$pcap' USING com.packetloop.packetpig.loaders.pcap.detection.SnortLoader('$snortconfig') AS ( 7 | ts:long, 8 | sig:chararray, 9 | priority:int, 10 | message:chararray, 11 | proto:chararray, 12 | src:chararray, 13 | sport:int, 14 | dst:chararray, 15 | dport:int 16 | ); 17 | 18 | fingerprints = LOAD '$pcap' USING com.packetloop.packetpig.loaders.pcap.detection.FingerprintLoader() AS ( 19 | ts:long, 20 | src:chararray, 21 | sport:int, 22 | dst:chararray, 23 | dport:int, 24 | os:chararray 25 | ); 26 | 27 | attacker_fingerprints = JOIN 28 | snort_alerts BY (src, sport, dst, dport), 29 | fingerprints BY (src, sport, dst, dport); 30 | 31 | DUMP attacker_fingerprints; 32 | -------------------------------------------------------------------------------- /pig/examples/p0f_fingerprint.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | fingerprints = LOAD '$pcap' USING com.packetloop.packetpig.loaders.pcap.detection.FingerprintLoader() AS ( 5 | ts:long, 6 | src:chararray, 7 | sport:int, 8 | dst:chararray, 9 | dport:int, 10 | os:chararray, 11 | app:chararray, 12 | dist:chararray, 13 | lang:chararray, 14 | params:chararray, 15 | raw_freq:chararray, 16 | raw_mtu:chararray, 17 | raw_sig:chararray, 18 | uptime:chararray 19 | ); 20 | 21 | fingerprint_freq = GROUP fingerprints BY os; 22 | summary = FOREACH fingerprint_freq GENERATE group, COUNT(fingerprints); 23 | dump fingerprints; 24 | --STORE summary INTO '$output/p0f_fingerprints'; 25 | 26 | -------------------------------------------------------------------------------- /pig/examples/packet_latency_histogram.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | %DEFAULT tcppath 'lib/scripts/tcp.py' 5 | 6 | conversations = LOAD '$pcap' 7 | USING com.packetloop.packetpig.loaders.pcap.conversation.ConversationLoader('$tcppath') AS ( 8 | ts:long, 9 | src:chararray, 10 | sport:int, 11 | dst:chararray, 12 | dport:int, 13 | end_state:chararray, 14 | timestamps, 15 | intervals 16 | ); 17 | 18 | r = FOREACH conversations GENERATE FLATTEN(com.packetloop.packetpig.udf.util.Explode(intervals)) AS interval; 19 | r = FOREACH r GENERATE (int)((double)interval * 1000) AS interval; 20 | r = GROUP r BY interval; 21 | r = FOREACH r GENERATE group, COUNT(r.interval); 22 | 23 | STORE r INTO '$output/packet_latency_histogram'; 24 | -------------------------------------------------------------------------------- /pig/examples/packets.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | packets = LOAD '$pcap' using com.packetloop.packetpig.loaders.pcap.packet.PacketLoader() AS ( 5 | ts:long, 6 | 7 | ip_version:int, 8 | ip_header_length:int, 9 | ip_tos:int, 10 | ip_total_length:int, 11 | ip_id:int, 12 | ip_flags:int, 13 | ip_frag_offset:int, 14 | ip_ttl:int, 15 | ip_proto:int, 16 | ip_checksum:int, 17 | ip_src:chararray, 18 | ip_dst:chararray, 19 | 20 | tcp_sport:int, 21 | tcp_dport:int, 22 | tcp_seq_id:long, 23 | tcp_ack_id:long, 24 | tcp_offset:int, 25 | tcp_ns:int, 26 | tcp_cwr:int, 27 | tcp_ece:int, 28 | tcp_urg:int, 29 | tcp_ack:int, 30 | tcp_psh:int, 31 | tcp_rst:int, 32 | tcp_syn:int, 33 | tcp_fin:int, 34 | tcp_window:int, 35 | tcp_len:int, 36 | 37 | udp_sport:int, 38 | udp_dport:int, 39 | udp_len:int, 40 | udp_checksum:chararray 41 | ); 42 | 43 | STORE packets INTO '$output/packets'; 44 | -------------------------------------------------------------------------------- /pig/examples/snort.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | %DEFAULT time 60 5 | %DEFAULT src null 6 | %DEFAULT dst null 7 | %DEFAULT sport null 8 | %DEFAULT dport null 9 | %DEFAULT snortconfig 'lib/snort/etc/snort.conf' 10 | 11 | snort_alerts = 12 | LOAD '$pcap' 13 | USING com.packetloop.packetpig.loaders.pcap.detection.SnortLoader('$snortconfig') 14 | AS ( 15 | ts:long, 16 | sig:chararray, 17 | priority:int, 18 | message:chararray, 19 | proto:chararray, 20 | src:chararray, 21 | sport:int, 22 | dst:chararray, 23 | dport:int 24 | ); 25 | STORE snort_alerts INTO '$output/snort'; 26 | 27 | -------------------------------------------------------------------------------- /pig/examples/snort_location.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | %DEFAULT snortconfig 'lib/snort/etc/snort.conf' 5 | 6 | snort_alerts = 7 | LOAD '$pcap' 8 | USING com.packetloop.packetpig.loaders.pcap.detection.SnortLoader('$snortconfig') 9 | AS (ts:long, sig:chararray, priority:int, message:chararray, proto:chararray, 10 | src:chararray, dst:chararray, sport:int, dport:int); 11 | 12 | locations = FOREACH snort_alerts 13 | GENERATE ts, 14 | com.packetloop.packetpig.udf.geoip.Country(src), 15 | com.packetloop.packetpig.udf.geoip.ASNum(src), 16 | com.packetloop.packetpig.udf.geoip.LatLon(src), 17 | priority; 18 | 19 | STORE locations INTO '$output/snort_locations'; 20 | -------------------------------------------------------------------------------- /pig/examples/user_agent.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | %DEFAULT time 60 5 | %DEFAULT field '' 6 | %DEFAULT tcppath 'lib/scripts/tcp.py' 7 | 8 | http = LOAD '$pcap' USING com.packetloop.packetpig.loaders.pcap.protocol.HTTPConversationLoader('user-agent', '$tcppath') AS ( 9 | ts:long, 10 | src:chararray, 11 | sport:int, 12 | dst:chararray, 13 | dport:int, 14 | request:chararray, 15 | fields:tuple() 16 | ); 17 | 18 | STORE http INTO '$output/http'; 19 | 20 | -------------------------------------------------------------------------------- /pig/globe/globe-snort.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | %DEFAULT snortconfig 'lib/snort/etc/snort.conf' 5 | 6 | snort_alerts = LOAD '$pcap' 7 | USING com.packetloop.packetpig.loaders.pcap.detection.SnortLoader('$snortconfig') 8 | AS ( 9 | ts:long, 10 | sig:chararray, 11 | priority:int, 12 | message:chararray, 13 | proto:chararray, 14 | src:chararray, 15 | sport:int, 16 | dst:chararray, 17 | dport:int 18 | ); 19 | 20 | latlon = FOREACH snort_alerts 21 | GENERATE ts, 22 | com.packetloop.packetpig.udf.geoip.LatLon(src) as ll, 23 | priority; 24 | 25 | latlon = GROUP latlon 26 | BY ll; 27 | 28 | latlon = FOREACH latlon 29 | GENERATE 30 | group, 31 | AVG(latlon.priority) as average_severity, 32 | COUNT(latlon.priority) as total_attacks; 33 | 34 | latlon = ORDER latlon BY total_attacks; 35 | 36 | STORE latlon into 'output/globe_snort' using PigStorage(','); 37 | 38 | -------------------------------------------------------------------------------- /pig/include-emr.pig: -------------------------------------------------------------------------------- 1 | register s3://packetpig/packetpig.jar 2 | register s3://packetpig/kraken-pcap-1.6.0.jar 3 | register s3://packetpig/piggybank.jar 4 | register s3://packetpig/commons-discovery-20040218.194635.jar 5 | register s3://packetpig/axis-1.4.jar 6 | register s3://packetpig/slf4j-api-1.6.4.jar 7 | register s3://packetpig/dnsjava-2.1.1.jar 8 | register s3://packetpig/mongo-2.9.0.jar 9 | register s3://packetpig/mongo-hadoop-core-1.1.0-SNAPSHOT.jar 10 | register s3://packetpig/mongo-hadoop-pig-1.1.0-SNAPSHOT.jar 11 | -------------------------------------------------------------------------------- /pig/include-hdfs.pig: -------------------------------------------------------------------------------- 1 | register hdfs:///packetpig/packetpig.jar 2 | register hdfs:///packetpig/kraken-pcap-1.6.0.jar 3 | register hdfs:///packetpig/piggybank.jar 4 | register hdfs:///packetpig/commons-discovery-20040218.194635.jar 5 | register hdfs:///packetpig/axis-1.4.jar 6 | register hdfs:///packetpig/slf4j-api-1.6.4.jar 7 | register hdfs:///packetpig/dnsjava-2.1.1.jar 8 | register hdfs:///packetpig/mongo-2.9.0.jar 9 | register hdfs:///packetpig/mongo-hadoop-core-1.1.0-SNAPSHOT.jar 10 | register hdfs:///packetpig/mongo-hadoop-pig-1.1.0-SNAPSHOT.jar 11 | -------------------------------------------------------------------------------- /pig/include.pig: -------------------------------------------------------------------------------- 1 | register lib/packetpig.jar 2 | register lib/kraken-pcap-1.6.0.jar 3 | register lib/piggybank.jar 4 | register lib/commons-discovery-20040218.194635.jar 5 | register lib/axis-1.4.jar 6 | register lib/slf4j-api-1.6.4.jar 7 | register lib/dnsjava-2.1.1.jar 8 | register lib/mongo-2.9.0.jar 9 | register lib/mongo-hadoop-core-1.1.0-SNAPSHOT.jar 10 | register lib/mongo-hadoop-pig-1.1.0-SNAPSHOT.jar 11 | -------------------------------------------------------------------------------- /pig/ubigraph/ubigraph-dns.pig: -------------------------------------------------------------------------------- 1 | %DEFAULT includepath pig/include.pig 2 | RUN $includepath; 3 | 4 | dns = LOAD '$pcap' USING com.packetloop.packetpig.loaders.pcap.protocol.DNSConversationLoader() AS ( 5 | ts:long, 6 | id:long, 7 | mode:chararray, 8 | name:chararray, 9 | addr:chararray, 10 | ttl:int 11 | ); 12 | 13 | STORE dns INTO 'output/ubigraph-dns' USING PigStorage(','); 14 | 15 | -------------------------------------------------------------------------------- /prepare-hdfs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source pig.sh 4 | 5 | for file in lib/*.jar; do 6 | hdfs $file 7 | done 8 | 9 | for file in `find pig -name '*.pig'`; do 10 | hdfs $file 11 | done 12 | 13 | hdfs data/GeoIP.dat 14 | hdfs data/GeoIPASNum.dat 15 | hdfs data/GeoLiteCity.dat 16 | 17 | -------------------------------------------------------------------------------- /put.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source pig.sh 4 | 5 | hdfs $1 6 | 7 | -------------------------------------------------------------------------------- /r/examples/attacker_useragents.r: -------------------------------------------------------------------------------- 1 | data <- read.csv("output/attacker_useragents/part-r-00000", header=F) 2 | 3 | pdf(file="output/attacker_useragents/plot.pdf") 4 | plot(data) 5 | -------------------------------------------------------------------------------- /r/examples/bandwidth.r: -------------------------------------------------------------------------------- 1 | library("zoo") 2 | library("xts") 3 | library("ggplot2") 4 | 5 | bandwidth <- read.csv("output/bandwidth/part-r-00000", header=F) 6 | 7 | z_bandwidth <- zoo(bandwidth$V2/(1024*1024), as.POSIXlt(bandwidth$V1,origin="1970-01-01", tz="GMT")) 8 | 9 | pdf(file="output/bandwidth/plot.pdf") 10 | 11 | plot(z_bandwidth) #,title="Bandwidth in MB/s",ylab="MB's") 12 | hist(z_bandwidth/(1024*1024), breaks=100, xlab="MB/s") 13 | qplot(z_bandwidth) # $V2/(1024*1024), stat='density', geom='line', ylab="Density") 14 | 15 | -------------------------------------------------------------------------------- /r/examples/binning.r: -------------------------------------------------------------------------------- 1 | library("zoo") 2 | library("xts") 3 | 4 | bins <- read.csv("output/binning/part-r-00000", header=F) 5 | z_tcp_data <- zoo(bins$V2/(1024*1024), as.POSIXlt(bins$V1,origin="1970-01-01", tz="GMT")) 6 | z_udp_data <- zoo(bins$V3/(1024*1024), as.POSIXlt(bins$V1,origin="1970-01-01", tz="GMT")) 7 | z_tot_data <- zoo(bins$V4/(1024*1024), as.POSIXlt(bins$V1,origin="1970-01-01", tz="GMT")) 8 | 9 | pdf(file="output/binning/plot.pdf") 10 | 11 | plot(z_tcp_data, col=2) 12 | lines(z_udp_data, col=3) 13 | lines(z_tot_data, col=5) 14 | -------------------------------------------------------------------------------- /r/examples/conversations.r: -------------------------------------------------------------------------------- 1 | library("zoo") 2 | library("xts") 3 | library("ggplot2") 4 | 5 | conversations <- read.csv("output/conversations/part-r-00000", header=F) 6 | 7 | pdf(file="output/conversations/plot.pdf") 8 | 9 | plot(conversations) 10 | -------------------------------------------------------------------------------- /r/examples/dns_response_ttl.r: -------------------------------------------------------------------------------- 1 | library("ggplot2") 2 | 3 | dns <- read.csv("output/dns_response_ttl/part-r-00000", header=F) 4 | 5 | pdf(file="output/dns_response_ttl/plot.pdf") 6 | 7 | ggplot(dns, aes(x=dns$V2, y=dns$V1)) + geom_point(shape=4) 8 | qplot(x=dns$V2, stat='density', geom='line', ylab="Density") 9 | -------------------------------------------------------------------------------- /r/examples/dns_response_ttl_facets.r: -------------------------------------------------------------------------------- 1 | library("ggplot2") 2 | 3 | dns <- read.csv("output/dns_response_ttl/part-r-00000", header=F) 4 | 5 | pdf(file="output/dns_response_ttl/plot.pdf") 6 | 7 | ggplot(dns, aes(x=dns$V2, y=dns$V1)) + geom_point(shape=4) 8 | ggplot(dns, aes(x=dns$V2, y=dns$V3)) + geom_point(shape=4) 9 | ggplot(dns, aes(x=dns$V2, y=dns$V3)) + geom_point(shape=4) + facet_grid(V1~.) 10 | qplot(x=dns$V2, stat='density', geom='line', ylab="Density") 11 | -------------------------------------------------------------------------------- /r/examples/extract_files.r: -------------------------------------------------------------------------------- 1 | files <- read.delim("output/extract_files/part-m-00000", header=F) 2 | 3 | pdf(file="output/extract_files/plot.pdf") 4 | 5 | plot(files$V12) 6 | -------------------------------------------------------------------------------- /r/examples/histogram.r: -------------------------------------------------------------------------------- 1 | histo <- read.delim("output/histogram/part-r-00000", header=F) 2 | 3 | pdf(file="output/histogram/plot.pdf") 4 | 5 | hist(histo$V1, breaks=50) 6 | -------------------------------------------------------------------------------- /r/examples/layered.r: -------------------------------------------------------------------------------- 1 | library(ggplot2) 2 | data <- data.frame(V1 <- rnorm(700), V2=sample(LETTERS[1:3], 700, replace=TRUE)) 3 | ggplot(data, aes(x=V1)) + 4 | stat_bin(aes(y=..density..)) + 5 | stat_function(fun=dnorm) + 6 | facet_grid(V2~.) 7 | -------------------------------------------------------------------------------- /r/examples/p0f_fingerprint.r: -------------------------------------------------------------------------------- 1 | fingerprints <- read.delim("output/p0f_fingerprints/part-r-00000", header=F) 2 | 3 | pdf(file="output/p0f_fingerprints/plot.pdf") 4 | 5 | plot(fingerprints) 6 | -------------------------------------------------------------------------------- /r/examples/protocol_size_histogram.r: -------------------------------------------------------------------------------- 1 | histo <- read.delim("output/protocol_size_histogram/part-r-00000", header=F) 2 | 3 | pdf(file="output/protocol_size_histogram/plot.pdf") 4 | 5 | plot(histo) 6 | 7 | -------------------------------------------------------------------------------- /r/examples/snort.r: -------------------------------------------------------------------------------- 1 | library("zoo") 2 | library("xts") 3 | library("ggplot2") 4 | 5 | attacks <- read.csv("../../out/snort/distinct/part-r-00000", header=F) 6 | 7 | z_attacks <- zoo(attacks$V6, as.POSIXlt(attacks$V1,origin="1970-01-01", tz="GMT")) 8 | 9 | plot(z_attacks,title="Time",ylab="Attacks") 10 | points(z_attacks, col='blue', pch=20, cex=1) 11 | qplot(x=attacks$V6, stat='density', geom='line', xlab="No of Attacks per bin period",ylab="Density") 12 | -------------------------------------------------------------------------------- /vis/lib/d3/.gitignore: -------------------------------------------------------------------------------- 1 | _site 2 | node_modules 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /vis/lib/d3/.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/d3/.gitmodules -------------------------------------------------------------------------------- /vis/lib/d3/.npmignore: -------------------------------------------------------------------------------- 1 | examples/ 2 | test/ 3 | lib/ 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/azimuthal/azimuthal.css: -------------------------------------------------------------------------------- 1 | @import url("../../lib/jquery-ui/jquery-ui.css"); 2 | 3 | body, .ui-widget { 4 | font: 14px Helvetica Neue; 5 | } 6 | 7 | svg { 8 | width: 960px; 9 | height: 500px; 10 | border: solid 1px #ccc; 11 | background: #eee; 12 | } 13 | 14 | path { 15 | fill: #ccc; 16 | stroke: #fff; 17 | } 18 | 19 | div { 20 | width: 960px; 21 | } 22 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/box/box.css: -------------------------------------------------------------------------------- 1 | .box { font: 10px sans-serif; } 2 | .box line, .box rect, .box circle { stroke: #000; stroke-width: 1.5px; fill: #fff; } 3 | .box .center { stroke-dasharray: 3 3; } 4 | .box .outlier { stroke: #ccc; fill: none; } 5 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/box/box.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Box Plot Charts 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |

16 |

17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/bubble/bubble.css: -------------------------------------------------------------------------------- 1 | circle { 2 | stroke: #fff; 3 | stroke-width: 1.5px; 4 | } 5 | 6 | text { 7 | font: 10px sans-serif; 8 | } 9 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/bubble/bubble.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Bubble Chart 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/bullet/bullet.css: -------------------------------------------------------------------------------- 1 | .bullet { font: 10px sans-serif; } 2 | .bullet .marker { stroke: #000; stroke-width: 2px; } 3 | .bullet .tick line { stroke: #666; stroke-width: .5px; } 4 | .bullet .range.s0 { fill: #eee; } 5 | .bullet .range.s1 { fill: #ddd; } 6 | .bullet .range.s2 { fill: #ccc; } 7 | .bullet .measure.s0 { fill: lightsteelblue; } 8 | .bullet .measure.s1 { fill: steelblue; } 9 | .bullet .title { font-size: 14px; font-weight: bold; } 10 | .bullet .subtitle { fill: #999; } 11 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/bullet/bullet.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bullet Charts 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |

15 |

16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/bullet/bullets.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"title":"Revenue","subtitle":"US$, in thousands","ranges":[150,225,300],"measures":[220,270],"markers":[250]}, 3 | {"title":"Profit","subtitle":"%","ranges":[20,25,30],"measures":[21,23],"markers":[26]}, 4 | {"title":"Order Size","subtitle":"US$, average","ranges":[350,500,600],"measures":[100,320],"markers":[550]}, 5 | {"title":"New Customers","subtitle":"count","ranges":[1400,2000,2500],"measures":[1000,1650],"markers":[2100]}, 6 | {"title":"Satisfaction","subtitle":"out of 5","ranges":[3.5,4.25,5],"measures":[3.2,4.7],"markers":[4.4]} 7 | ] 8 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/bundle/bundle-radial.css: -------------------------------------------------------------------------------- 1 | .node { 2 | font: 10px sans-serif; 3 | } 4 | 5 | .link { 6 | stroke: steelblue; 7 | stroke-opacity: .4; 8 | fill: none; 9 | } 10 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/bundle/bundle-radial.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hierarchical Edge Bundling (Radial Tree) 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/bundle/bundle-treemap.css: -------------------------------------------------------------------------------- 1 | .cell { 2 | border: solid 1px white; 3 | font: 10px sans-serif; 4 | line-height: 12px; 5 | overflow: hidden; 6 | position: absolute; 7 | text-indent: 2px; 8 | } 9 | 10 | .link { 11 | stroke: #000; 12 | stroke-opacity: .5; 13 | fill: none; 14 | } 15 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/bundle/bundle-treemap.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hierarchical Edge Bundling (Treemap) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/calendar/calendar.css: -------------------------------------------------------------------------------- 1 | #chart { 2 | font: 10px sans-serif; 3 | shape-rendering: crispEdges; 4 | } 5 | 6 | .day { 7 | fill: #fff; 8 | stroke: #ccc; 9 | } 10 | 11 | .month { 12 | fill: none; 13 | stroke: #000; 14 | stroke-width: 2px; 15 | } 16 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/calendar/dji.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DJI 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/calendar/vix.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | VIX 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/cartogram/cartogram.css: -------------------------------------------------------------------------------- 1 | #chart { 2 | width: 960px; 3 | height: 500px; 4 | } 5 | 6 | .black path { 7 | fill: none; 8 | stroke: #ccc; 9 | stroke-width: 3px; 10 | } 11 | 12 | .white path { 13 | fill: #fff; 14 | stroke: #fff; 15 | } 16 | 17 | .grey path { 18 | fill: #ccc; 19 | stroke: #666; 20 | } 21 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/cartogram/cartogram.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Non-Contiguous Cartogram 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/cartogram/demers.css: -------------------------------------------------------------------------------- 1 | #chart { 2 | width: 960px; 3 | height: 500px; 4 | } 5 | 6 | rect { 7 | stroke: #000; 8 | stroke-width: .5px; 9 | } 10 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/cartogram/demers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Demers Cartogram 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/cartogram/dorling.css: -------------------------------------------------------------------------------- 1 | #chart { 2 | width: 960px; 3 | height: 500px; 4 | } 5 | 6 | circle { 7 | stroke: #000; 8 | stroke-width: .5px; 9 | } 10 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/cartogram/dorling.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Dorling Cartogram 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/chord/chord.css: -------------------------------------------------------------------------------- 1 | #chart { 2 | font: 10px sans-serif; 3 | } 4 | 5 | .chord path { 6 | fill-opacity: .67; 7 | stroke: #000; 8 | stroke-width: .5px; 9 | } 10 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/chord/chord.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Chord Diagram 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/choropleth/choropleth.css: -------------------------------------------------------------------------------- 1 | svg { 2 | background: #eee; 3 | width: 960px; 4 | height: 500px; 5 | } 6 | 7 | #counties path { 8 | stroke: #fff; 9 | stroke-width: .25px; 10 | } 11 | 12 | #states path { 13 | fill: none; 14 | stroke: #fff; 15 | stroke-width: 1.5px; 16 | } 17 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/choropleth/choropleth.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | U.S. Unemployment by County 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/clock/clock.css: -------------------------------------------------------------------------------- 1 | #clock { 2 | position: relative; 3 | background: #222; 4 | width: 960px; 5 | height: 700px; 6 | } 7 | 8 | #clock div { 9 | position: absolute; 10 | right: 4px; 11 | bottom: 4px; 12 | color: #ddd; 13 | font: 10px sans-serif; 14 | } 15 | 16 | #clock a { 17 | color: #fff; 18 | font-weight: bold; 19 | } 20 | 21 | text { 22 | font: bold 13px sans-serif; 23 | } 24 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/clock/clock.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Polar Clock 5 | 6 | 7 | 8 | 9 | 10 |
11 |
12 | Inspired by pixelbreaker. 13 |
14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/cluster/cluster-radial.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Flare Dendogram 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/cluster/cluster.css: -------------------------------------------------------------------------------- 1 | .node circle { 2 | fill: #fff; 3 | stroke: steelblue; 4 | stroke-width: 1.5px; 5 | } 6 | 7 | .node { 8 | font: 10px sans-serif; 9 | } 10 | 11 | .link { 12 | fill: none; 13 | stroke: #ccc; 14 | stroke-width: 1.5px; 15 | } 16 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/cluster/cluster.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Flare Dendogram 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/data/README.md: -------------------------------------------------------------------------------- 1 | ## World Boundaries 2 | 3 | These are derived from the public domain [Natural Earth](http://www.naturalearthdata.com/downloads/) cultural vector files, 110m resolution. Then, ogr2ogr was used to convert to GeoJSON. Lastly, the data was cleaned up slightly, removing extra properties and a degenerate edge from Antarctica. 4 | 5 | collection.features.forEach(function(d, i) { 6 | d.id = d.properties.ISO_A3; 7 | d.properties = {name: d.properties.SOVEREIGNT}; 8 | }); 9 | 10 | ## United States Boundaries 11 | 12 | These are derived from the cartographic boundary files from the 2000 [U.S. Census](http://www.census.gov/geo/www/cob/bdy_files.html 13 | ). Then, MapShaper was used to simplify the geometry, and ogr2ogr to convert the shapefiles to GeoJSON. Some additional work was done to preserve the FIPS codes, which are dropped from the shapefiles by MapShaper. 14 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/data/sample.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Hello & world!

5 | 6 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/data/sample.json: -------------------------------------------------------------------------------- 1 | [{"Hello":42,"World":"\"fish\""}] 2 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/data/sample.txt: -------------------------------------------------------------------------------- 1 | Hello, world! 2 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/data/sample.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/force/README: -------------------------------------------------------------------------------- 1 | The miserables.json file contains the weighted network of coappearances of 2 | characters in Victor Hugo's novel /Les Miserables/. Nodes represent characters 3 | as indicated by the labels, and edges connect any pair of characters that 4 | appear in the same chapter of the book. The values on the edges are the number 5 | of such coappearances. The data on coappearances were taken from D. E. Knuth, 6 | "The Stanford GraphBase: A Platform for Combinatorial Computing", 7 | Addison-Wesley, Reading, MA (1993). 8 | 9 | The group labels were transcribed from "Finding and evaluating community 10 | structure in networks" by M. E. J. Newman and M. Girvan. 11 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/force/force.css: -------------------------------------------------------------------------------- 1 | circle.node { 2 | stroke: #fff; 3 | stroke-width: 1.5px; 4 | } 5 | 6 | line.link { 7 | stroke: #999; 8 | stroke-opacity: .6; 9 | } 10 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/force/force.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Force-Directed Layout 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/hello-world/hello-node-key.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello, node! 5 | 6 | 7 | 8 | Your lucky numbers are:
9 | 10 | 11 | 12 | 13 | 14 | 15 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/hello-world/hello-order.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/hello-world/select-enter-add.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Test - select > enter > append 5 | 6 | 7 | 8 | 9 | 10 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/hello-world/selectAll-enter-add.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Test - selectAll > enter > append 5 | 6 | 7 | 8 | 9 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/horizon/horizon.css: -------------------------------------------------------------------------------- 1 | #controls { 2 | position: relative; 3 | width: 960px; 4 | } 5 | 6 | #bands { 7 | position: absolute; 8 | right: 0; 9 | } 10 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/horizon/horizon.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Horizon Chart 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 | 15 | 17 | 18 | 19 | 21 | 22 |
23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/kde/kde.css: -------------------------------------------------------------------------------- 1 | body { 2 | font: 10px sans-serif; 3 | } 4 | 5 | path { 6 | stroke: #000; 7 | stroke-width: 1.5px; 8 | fill: none; 9 | } 10 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/kde/kde.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Kernel Density Estimation 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/line/line.css: -------------------------------------------------------------------------------- 1 | body { 2 | font: 10px sans-serif; 3 | } 4 | 5 | .rule line { 6 | stroke: #eee; 7 | shape-rendering: crispEdges; 8 | } 9 | 10 | .rule line.axis { 11 | stroke: #000; 12 | } 13 | 14 | .line { 15 | fill: none; 16 | stroke: steelblue; 17 | stroke-width: 1.5px; 18 | } 19 | 20 | circle.line { 21 | fill: #fff; 22 | } 23 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/line/line.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Line Chart 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/pack/pack.css: -------------------------------------------------------------------------------- 1 | circle { 2 | fill: rgb(31, 119, 180); 3 | fill-opacity: .25; 4 | stroke: rgb(31, 119, 180); 5 | stroke-width: 1px; 6 | } 7 | 8 | .leaf circle { 9 | fill: #ff7f0e; 10 | fill-opacity: 1; 11 | } 12 | 13 | text { 14 | font: 10px sans-serif; 15 | } 16 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/pack/pack.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Circle Packing 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/partition/partition-sunburst.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Partition - Sunburst 6 | 7 | 8 | 9 | 10 | 11 |
12 |

18 |

19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/population/population.css: -------------------------------------------------------------------------------- 1 | svg { 2 | font: 10px sans-serif; 3 | } 4 | 5 | text.title { 6 | font: 300 78px Helvetica Neue; 7 | fill: #666; 8 | } 9 | 10 | .rule line { 11 | stroke: #fff; 12 | stroke-opacity: .2; 13 | shape-rendering: crispEdges; 14 | } 15 | 16 | .rule:first-child line { 17 | stroke: #000; 18 | stroke-opacity: 1; 19 | } 20 | 21 | rect { 22 | fill-opacity: .6; 23 | fill: #e377c2; 24 | } 25 | 26 | rect:first-child { 27 | fill: #1f77b4; 28 | } 29 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/population/population.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | U.S. Population 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/qq/qq.css: -------------------------------------------------------------------------------- 1 | #chart { 2 | font: 10px sans-serif; 3 | width: 960px; 4 | height: 310px; 5 | } 6 | 7 | .qq .box, .qq .tick line, .qq .quantile, .qq .diagonal { 8 | stroke: #aaa; 9 | fill: none; 10 | } 11 | 12 | .qq .quantile { 13 | stroke: #000; 14 | } 15 | 16 | .qq g + g .y.tick { 17 | display: none; 18 | } 19 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/qq/qq.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Q-Q Plots 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 17 |
18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/qq/stats.js: -------------------------------------------------------------------------------- 1 | // Sample from a normal distribution with mean 0, stddev 1. 2 | function normal() { 3 | var x = 0, y = 0, rds, c; 4 | do { 5 | x = Math.random() * 2 - 1; 6 | y = Math.random() * 2 - 1; 7 | rds = x * x + y * y; 8 | } while (rds == 0 || rds > 1); 9 | c = Math.sqrt(-2 * Math.log(rds) / rds); // Box-Muller transform 10 | return x * c; // throw away extra sample y * c 11 | } 12 | 13 | // Simple 1D Gaussian (normal) distribution 14 | function normal1(mean, deviation) { 15 | return function() { 16 | return mean + deviation * normal(); 17 | }; 18 | } 19 | 20 | // Gaussian Mixture Model (k=3) fit using E-M algorithm 21 | function normal3(dd) { 22 | return function() { 23 | var r = Math.random(), 24 | i = r < dd[0][2] ? 0 : r < dd[0][2] + dd[1][2] ? 1 : 2, 25 | d = dd[i]; 26 | return d[0] + Math.sqrt(d[1]) * normal(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/sizzle/sizzle.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Sizzle 5 | 6 | 7 | 16 | 17 | 18 | Sizzle.js disabled. 19 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/sort/sort.css: -------------------------------------------------------------------------------- 1 | line { 2 | stroke: #000; 3 | stroke-width: 1.5px; 4 | } 5 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/sort/sort.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Merge Sort 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/spline/spline.css: -------------------------------------------------------------------------------- 1 | body { 2 | font: 13px sans-serif; 3 | } 4 | 5 | #chart svg { 6 | width: 960px; 7 | height: 500px; 8 | border: solid 1px #ccc; 9 | } 10 | 11 | rect { 12 | fill: #fff; 13 | } 14 | 15 | circle, .line { 16 | fill: none; 17 | stroke: steelblue; 18 | stroke-width: 1.5px; 19 | } 20 | 21 | circle { 22 | fill: #fff; 23 | fill-opacity: .2; 24 | cursor: move; 25 | } 26 | 27 | circle.selected { 28 | fill: #ff7f0e; 29 | stroke: #ff7f0e; 30 | } 31 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/spline/spline.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Spline Editor 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/splom/splom.css: -------------------------------------------------------------------------------- 1 | svg { 2 | font: 10px sans-serif; 3 | } 4 | 5 | .axis { 6 | shape-rendering: crispEdges; 7 | } 8 | 9 | .axis line { 10 | stroke: #ddd; 11 | stroke-width: .5px; 12 | } 13 | 14 | .axis path { 15 | display: none; 16 | } 17 | 18 | rect.extent { 19 | fill: #000; 20 | fill-opacity: .125; 21 | stroke: #fff; 22 | } 23 | 24 | rect.frame { 25 | fill: #fff; 26 | fill-opacity: .7; 27 | stroke: #aaa; 28 | } 29 | 30 | circle { 31 | fill: #ccc; 32 | fill-opacity: .5; 33 | } 34 | 35 | .cell text { 36 | pointer-events: none; 37 | } 38 | 39 | .setosa { 40 | fill: #800; 41 | } 42 | 43 | .versicolor { 44 | fill: #080; 45 | } 46 | 47 | .virginica { 48 | fill: #008; 49 | } 50 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/splom/splom.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Scatterplot Matrix 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/stream/stack.css: -------------------------------------------------------------------------------- 1 | #chart { 2 | font: 10px sans-serif; 3 | } 4 | 5 | line { 6 | stroke: black; 7 | } 8 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/stream/stack.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Stacked Bar Chart 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |

19 |

20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/stream/stream.css: -------------------------------------------------------------------------------- 1 | #chart { 2 | font: 10px sans-serif; 3 | } 4 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/stream/stream.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Streamgraph 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |

16 |

17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/tree/tree-radial.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Node-Link Tree (Radial) 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/tree/tree.css: -------------------------------------------------------------------------------- 1 | .node circle { 2 | fill: #fff; 3 | stroke: steelblue; 4 | stroke-width: 1.5px; 5 | } 6 | 7 | .node { 8 | font: 10px sans-serif; 9 | } 10 | 11 | .link { 12 | fill: none; 13 | stroke: #ccc; 14 | stroke-width: 1.5px; 15 | } 16 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/tree/tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Node-Link Tree 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/treemap/treemap-svg.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/treemap/treemap.css: -------------------------------------------------------------------------------- 1 | .cell { 2 | border: solid 1px white; 3 | font: 10px sans-serif; 4 | line-height: 12px; 5 | overflow: hidden; 6 | position: absolute; 7 | text-indent: 2px; 8 | } 9 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/treemap/treemap.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Treemap 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |

19 |

20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/voroboids/voroboids.css: -------------------------------------------------------------------------------- 1 | svg { 2 | display: block; 3 | border: solid 1px #666; 4 | overflow: hidden; 5 | } 6 | 7 | path { 8 | stroke: #000; 9 | stroke-width: .5px; 10 | } 11 | 12 | circle { 13 | fill: none; 14 | stroke: #fff; 15 | } 16 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/voroboids/voroboids.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Voroboids 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/voronoi/voronoi.css: -------------------------------------------------------------------------------- 1 | svg { 2 | border: solid 1px #666; 3 | overflow: hidden; 4 | } 5 | 6 | path { 7 | fill: yellow; 8 | stroke: #000; 9 | stroke-width: .5px; 10 | } 11 | 12 | circle { 13 | fill: #ccc; 14 | stroke: #000; 15 | pointer-events: none; 16 | } 17 | -------------------------------------------------------------------------------- /vis/lib/d3/examples/voronoi/voronoi.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Voronoi Tesselation 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /vis/lib/d3/lib/jquery-ui/images/ui-bg_diagonals-thick_18_b81900_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/d3/lib/jquery-ui/images/ui-bg_diagonals-thick_18_b81900_40x40.png -------------------------------------------------------------------------------- /vis/lib/d3/lib/jquery-ui/images/ui-bg_diagonals-thick_20_666666_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/d3/lib/jquery-ui/images/ui-bg_diagonals-thick_20_666666_40x40.png -------------------------------------------------------------------------------- /vis/lib/d3/lib/jquery-ui/images/ui-bg_flat_10_000000_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/d3/lib/jquery-ui/images/ui-bg_flat_10_000000_40x100.png -------------------------------------------------------------------------------- /vis/lib/d3/lib/jquery-ui/images/ui-bg_glass_100_f6f6f6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/d3/lib/jquery-ui/images/ui-bg_glass_100_f6f6f6_1x400.png -------------------------------------------------------------------------------- /vis/lib/d3/lib/jquery-ui/images/ui-bg_glass_100_fdf5ce_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/d3/lib/jquery-ui/images/ui-bg_glass_100_fdf5ce_1x400.png -------------------------------------------------------------------------------- /vis/lib/d3/lib/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/d3/lib/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /vis/lib/d3/lib/jquery-ui/images/ui-bg_gloss-wave_35_f6a828_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/d3/lib/jquery-ui/images/ui-bg_gloss-wave_35_f6a828_500x100.png -------------------------------------------------------------------------------- /vis/lib/d3/lib/jquery-ui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/d3/lib/jquery-ui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png -------------------------------------------------------------------------------- /vis/lib/d3/lib/jquery-ui/images/ui-bg_highlight-soft_75_ffe45c_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/d3/lib/jquery-ui/images/ui-bg_highlight-soft_75_ffe45c_1x100.png -------------------------------------------------------------------------------- /vis/lib/d3/lib/jquery-ui/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/d3/lib/jquery-ui/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /vis/lib/d3/lib/jquery-ui/images/ui-icons_228ef1_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/d3/lib/jquery-ui/images/ui-icons_228ef1_256x240.png -------------------------------------------------------------------------------- /vis/lib/d3/lib/jquery-ui/images/ui-icons_ef8c08_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/d3/lib/jquery-ui/images/ui-icons_ef8c08_256x240.png -------------------------------------------------------------------------------- /vis/lib/d3/lib/jquery-ui/images/ui-icons_ffd27a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/d3/lib/jquery-ui/images/ui-icons_ffd27a_256x240.png -------------------------------------------------------------------------------- /vis/lib/d3/lib/jquery-ui/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/d3/lib/jquery-ui/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /vis/lib/d3/lib/science/science.lin.js: -------------------------------------------------------------------------------- 1 | (function(){science.lin = {}; 2 | /** 3 | * Solves tridiagonal systems of linear equations. 4 | * 5 | * Source: http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm 6 | * 7 | * @param {number[]} a 8 | * @param {number[]} b 9 | * @param {number[]} c 10 | * @param {number[]} d 11 | * @param {number[]} x 12 | * @param {number} n 13 | */ 14 | science.lin.tridag = function(a, b, c, d, x, n) { 15 | var i, 16 | m; 17 | for (i = 1; i < n; i++) { 18 | m = a[i] / b[i - 1]; 19 | b[i] -= m * c[i - 1]; 20 | d[i] -= m * d[i - 1]; 21 | } 22 | x[n - 1] = d[n - 1] / b[n - 1]; 23 | for (i = n - 2; i >= 0; i--) { 24 | x[i] = (d[i] - c[i] * x[i + 1]) / b[i]; 25 | } 26 | }; 27 | })() -------------------------------------------------------------------------------- /vis/lib/d3/lib/science/science.lin.min.js: -------------------------------------------------------------------------------- 1 | (function(){science.lin={},science.lin.tridag=function(a,b,c,d,e,f){var g,h;for(g=1;g=0;g--)e[g]=(d[g]-c[g]*e[g+1])/b[g]}})() -------------------------------------------------------------------------------- /vis/lib/d3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "d3", 3 | "version": "2.7.4", 4 | "description": "A small, free JavaScript library for manipulating documents based on data.", 5 | "keywords": [ 6 | "dom", 7 | "w3c", 8 | "visualization", 9 | "svg", 10 | "animation", 11 | "canvas" 12 | ], 13 | "homepage": "http://mbostock.github.com/d3/", 14 | "author": { 15 | "name": "Mike Bostock", 16 | "url": "http://bost.ocks.org/mike" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "http://github.com/mbostock/d3.git" 21 | }, 22 | "main": "d3.js", 23 | "dependencies": { 24 | "jsdom": "0.2.10" 25 | }, 26 | "devDependencies": { 27 | "uglify-js": "1.2.3", 28 | "vows": "0.6.x" 29 | }, 30 | "scripts": { 31 | "test": "./node_modules/vows/bin/vows" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vis/lib/d3/src/behavior/behavior.js: -------------------------------------------------------------------------------- 1 | d3.behavior = {}; 2 | -------------------------------------------------------------------------------- /vis/lib/d3/src/chart/chart.js: -------------------------------------------------------------------------------- 1 | d3.chart = {}; 2 | -------------------------------------------------------------------------------- /vis/lib/d3/src/compat/date.js: -------------------------------------------------------------------------------- 1 | if (!Date.now) Date.now = function() { 2 | return +new Date; 3 | }; 4 | -------------------------------------------------------------------------------- /vis/lib/d3/src/compat/style.js: -------------------------------------------------------------------------------- 1 | try { 2 | document.createElement("div").style.setProperty("opacity", 0, ""); 3 | } catch (error) { 4 | var d3_style_prototype = CSSStyleDeclaration.prototype, 5 | d3_style_setProperty = d3_style_prototype.setProperty; 6 | d3_style_prototype.setProperty = function(name, value, priority) { 7 | d3_style_setProperty.call(this, name, value + "", priority); 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/array.js: -------------------------------------------------------------------------------- 1 | var d3_array = d3_arraySlice; // conversion for NodeLists 2 | 3 | function d3_arrayCopy(pseudoarray) { 4 | var i = -1, n = pseudoarray.length, array = []; 5 | while (++i < n) array.push(pseudoarray[i]); 6 | return array; 7 | } 8 | 9 | function d3_arraySlice(pseudoarray) { 10 | return Array.prototype.slice.call(pseudoarray); 11 | } 12 | 13 | try { 14 | d3_array(document.documentElement.childNodes)[0].nodeType; 15 | } catch(e) { 16 | d3_array = d3_arrayCopy; 17 | } 18 | 19 | var d3_arraySubclass = [].__proto__? 20 | 21 | // Until ECMAScript supports array subclassing, prototype injection works well. 22 | function(array, prototype) { 23 | array.__proto__ = prototype; 24 | }: 25 | 26 | // And if your browser doesn't support __proto__, we'll use direct extension. 27 | function(array, prototype) { 28 | for (var property in prototype) array[property] = prototype[property]; 29 | }; 30 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/ascending.js: -------------------------------------------------------------------------------- 1 | d3.ascending = function(a, b) { 2 | return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; 3 | }; 4 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/collapse.js: -------------------------------------------------------------------------------- 1 | function d3_collapse(s) { 2 | return s.replace(/(^\s+)|(\s+$)/g, "").replace(/\s+/g, " "); 3 | } 4 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/core.js: -------------------------------------------------------------------------------- 1 | d3 = {version: "2.7.4"}; // semver 2 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/descending.js: -------------------------------------------------------------------------------- 1 | d3.descending = function(a, b) { 2 | return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; 3 | }; 4 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/entries.js: -------------------------------------------------------------------------------- 1 | d3.entries = function(map) { 2 | var entries = []; 3 | for (var key in map) entries.push({key: key, value: map[key]}); 4 | return entries; 5 | }; 6 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/event.js: -------------------------------------------------------------------------------- 1 | d3.event = null; 2 | 3 | function d3_eventCancel() { 4 | d3.event.stopPropagation(); 5 | d3.event.preventDefault(); 6 | } 7 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/extent.js: -------------------------------------------------------------------------------- 1 | d3.extent = function(array, f) { 2 | var i = -1, 3 | n = array.length, 4 | a, 5 | b, 6 | c; 7 | if (arguments.length === 1) { 8 | while (++i < n && ((a = c = array[i]) == null || a != a)) a = c = undefined; 9 | while (++i < n) if ((b = array[i]) != null) { 10 | if (a > b) a = b; 11 | if (c < b) c = b; 12 | } 13 | } else { 14 | while (++i < n && ((a = c = f.call(array, array[i], i)) == null || a != a)) a = undefined; 15 | while (++i < n) if ((b = f.call(array, array[i], i)) != null) { 16 | if (a > b) a = b; 17 | if (c < b) c = b; 18 | } 19 | } 20 | return [a, c]; 21 | }; 22 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/first.js: -------------------------------------------------------------------------------- 1 | d3.first = function(array, f) { 2 | var i = 0, 3 | n = array.length, 4 | a = array[0], 5 | b; 6 | if (arguments.length === 1) f = d3.ascending; 7 | while (++i < n) { 8 | if (f.call(array, a, b = array[i]) > 0) { 9 | a = b; 10 | } 11 | } 12 | return a; 13 | }; 14 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/formatPrefix.js: -------------------------------------------------------------------------------- 1 | var d3_formatPrefixes = ["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(d3_formatPrefix); 2 | 3 | d3.formatPrefix = function(value, precision) { 4 | var i = 0; 5 | if (value) { 6 | if (value < 0) value *= -1; 7 | if (precision) value = d3.round(value, d3_format_precision(value, precision)); 8 | i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10); 9 | i = Math.max(-24, Math.min(24, Math.floor((i <= 0 ? i + 1 : i - 1) / 3) * 3)); 10 | } 11 | return d3_formatPrefixes[8 + i / 3]; 12 | }; 13 | 14 | function d3_formatPrefix(d, i) { 15 | return { 16 | scale: Math.pow(10, (8 - i) * 3), 17 | symbol: d 18 | }; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/functor.js: -------------------------------------------------------------------------------- 1 | d3.functor = function(v) { 2 | return typeof v === "function" ? v : function() { return v; }; 3 | }; 4 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/html.js: -------------------------------------------------------------------------------- 1 | d3.html = function(url, callback) { 2 | d3.text(url, "text/html", function(text) { 3 | if (text != null) { // Treat empty string as valid HTML. 4 | var range = document.createRange(); 5 | range.selectNode(document.body); 6 | text = range.createContextualFragment(text); 7 | } 8 | callback(text); 9 | }); 10 | }; 11 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/json.js: -------------------------------------------------------------------------------- 1 | d3.json = function(url, callback) { 2 | d3.text(url, "application/json", function(text) { 3 | callback(text ? JSON.parse(text) : null); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/keys.js: -------------------------------------------------------------------------------- 1 | d3.keys = function(map) { 2 | var keys = []; 3 | for (var key in map) keys.push(key); 4 | return keys; 5 | }; 6 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/last.js: -------------------------------------------------------------------------------- 1 | d3.last = function(array, f) { 2 | var i = 0, 3 | n = array.length, 4 | a = array[0], 5 | b; 6 | if (arguments.length === 1) f = d3.ascending; 7 | while (++i < n) { 8 | if (f.call(array, a, b = array[i]) <= 0) { 9 | a = b; 10 | } 11 | } 12 | return a; 13 | }; 14 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/max.js: -------------------------------------------------------------------------------- 1 | d3.max = function(array, f) { 2 | var i = -1, 3 | n = array.length, 4 | a, 5 | b; 6 | if (arguments.length === 1) { 7 | while (++i < n && ((a = array[i]) == null || a != a)) a = undefined; 8 | while (++i < n) if ((b = array[i]) != null && b > a) a = b; 9 | } else { 10 | while (++i < n && ((a = f.call(array, array[i], i)) == null || a != a)) a = undefined; 11 | while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b; 12 | } 13 | return a; 14 | }; 15 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/mean.js: -------------------------------------------------------------------------------- 1 | d3.mean = function(array, f) { 2 | var n = array.length, 3 | a, 4 | m = 0, 5 | i = -1, 6 | j = 0; 7 | if (arguments.length === 1) { 8 | while (++i < n) if (d3_number(a = array[i])) m += (a - m) / ++j; 9 | } else { 10 | while (++i < n) if (d3_number(a = f.call(array, array[i], i))) m += (a - m) / ++j; 11 | } 12 | return j ? m : undefined; 13 | }; 14 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/median.js: -------------------------------------------------------------------------------- 1 | d3.median = function(array, f) { 2 | if (arguments.length > 1) array = array.map(f); 3 | array = array.filter(d3_number); 4 | return array.length ? d3.quantile(array.sort(d3.ascending), .5) : undefined; 5 | }; 6 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/merge.js: -------------------------------------------------------------------------------- 1 | d3.merge = function(arrays) { 2 | return Array.prototype.concat.apply([], arrays); 3 | }; 4 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/min.js: -------------------------------------------------------------------------------- 1 | d3.min = function(array, f) { 2 | var i = -1, 3 | n = array.length, 4 | a, 5 | b; 6 | if (arguments.length === 1) { 7 | while (++i < n && ((a = array[i]) == null || a != a)) a = undefined; 8 | while (++i < n) if ((b = array[i]) != null && a > b) a = b; 9 | } else { 10 | while (++i < n && ((a = f.call(array, array[i], i)) == null || a != a)) a = undefined; 11 | while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b; 12 | } 13 | return a; 14 | }; 15 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/noop.js: -------------------------------------------------------------------------------- 1 | function d3_noop() {} 2 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/ns.js: -------------------------------------------------------------------------------- 1 | var d3_nsPrefix = { 2 | svg: "http://www.w3.org/2000/svg", 3 | xhtml: "http://www.w3.org/1999/xhtml", 4 | xlink: "http://www.w3.org/1999/xlink", 5 | xml: "http://www.w3.org/XML/1998/namespace", 6 | xmlns: "http://www.w3.org/2000/xmlns/" 7 | }; 8 | 9 | d3.ns = { 10 | prefix: d3_nsPrefix, 11 | qualify: function(name) { 12 | var i = name.indexOf(":"); 13 | return i < 0 ? (name in d3_nsPrefix 14 | ? {space: d3_nsPrefix[name], local: name} : name) 15 | : {space: d3_nsPrefix[name.substring(0, i)], local: name.substring(i + 1)}; 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/number.js: -------------------------------------------------------------------------------- 1 | function d3_number(x) { 2 | return x != null && !isNaN(x); 3 | } 4 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/permute.js: -------------------------------------------------------------------------------- 1 | d3.permute = function(array, indexes) { 2 | var permutes = [], 3 | i = -1, 4 | n = indexes.length; 5 | while (++i < n) permutes[i] = array[indexes[i]]; 6 | return permutes; 7 | }; 8 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/quantile.js: -------------------------------------------------------------------------------- 1 | // R-7 per 2 | d3.quantile = function(values, p) { 3 | var H = (values.length - 1) * p + 1, 4 | h = Math.floor(H), 5 | v = values[h - 1], 6 | e = H - h; 7 | return e ? v + e * (values[h] - v) : v; 8 | }; 9 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/random.js: -------------------------------------------------------------------------------- 1 | d3.random = { 2 | normal: function(mean, deviation) { 3 | if (arguments.length < 2) deviation = 1; 4 | if (arguments.length < 1) mean = 0; 5 | return function() { 6 | var x, y, r; 7 | do { 8 | x = Math.random() * 2 - 1; 9 | y = Math.random() * 2 - 1; 10 | r = x * x + y * y; 11 | } while (!r || r > 1); 12 | return mean + deviation * x * Math.sqrt(-2 * Math.log(r) / r); 13 | }; 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/range.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {number} start 3 | * @param {number=} stop 4 | * @param {number=} step 5 | */ 6 | d3.range = function(start, stop, step) { 7 | if (arguments.length < 3) { 8 | step = 1; 9 | if (arguments.length < 2) { 10 | stop = start; 11 | start = 0; 12 | } 13 | } 14 | if ((stop - start) / step == Infinity) throw new Error("infinite range"); 15 | var range = [], 16 | i = -1, 17 | j; 18 | if (step < 0) while ((j = start + step * ++i) > stop) range.push(j); 19 | else while ((j = start + step * ++i) < stop) range.push(j); 20 | return range; 21 | }; 22 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/rebind.js: -------------------------------------------------------------------------------- 1 | // Copies a variable number of methods from source to target. 2 | d3.rebind = function(target, source) { 3 | var i = 1, n = arguments.length, method; 4 | while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]); 5 | return target; 6 | }; 7 | 8 | // Method is assumed to be a standard D3 getter-setter: 9 | // If passed with no arguments, gets the value. 10 | // If passed with arguments, sets the value and returns the target. 11 | function d3_rebind(target, source, method) { 12 | return function() { 13 | var value = method.apply(source, arguments); 14 | return arguments.length ? target : value; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/requote.js: -------------------------------------------------------------------------------- 1 | d3.requote = function(s) { 2 | return s.replace(d3_requote_re, "\\$&"); 3 | }; 4 | 5 | var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g; 6 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/round.js: -------------------------------------------------------------------------------- 1 | d3.round = function(x, n) { 2 | return n 3 | ? Math.round(x * (n = Math.pow(10, n))) / n 4 | : Math.round(x); 5 | }; 6 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-append.js: -------------------------------------------------------------------------------- 1 | // TODO append(node)? 2 | // TODO append(function)? 3 | d3_selectionPrototype.append = function(name) { 4 | name = d3.ns.qualify(name); 5 | 6 | function append() { 7 | return this.appendChild(document.createElementNS(this.namespaceURI, name)); 8 | } 9 | 10 | function appendNS() { 11 | return this.appendChild(document.createElementNS(name.space, name.local)); 12 | } 13 | 14 | return this.select(name.local ? appendNS : append); 15 | }; 16 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-call.js: -------------------------------------------------------------------------------- 1 | // 2 | // Note: assigning to the arguments array simultaneously changes the value of 3 | // the corresponding argument! 4 | // 5 | // TODO The `this` argument probably shouldn't be the first argument to the 6 | // callback, anyway, since it's redundant. However, that will require a major 7 | // version bump due to backwards compatibility, so I'm not changing it right 8 | // away. 9 | // 10 | d3_selectionPrototype.call = function(callback) { 11 | callback.apply(this, (arguments[0] = this, arguments)); 12 | return this; 13 | }; 14 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-each.js: -------------------------------------------------------------------------------- 1 | d3_selectionPrototype.each = function(callback) { 2 | for (var j = -1, m = this.length; ++j < m;) { 3 | for (var group = this[j], i = -1, n = group.length; ++i < n;) { 4 | var node = group[i]; 5 | if (node) callback.call(node, node.__data__, i, j); 6 | } 7 | } 8 | return this; 9 | }; 10 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-empty.js: -------------------------------------------------------------------------------- 1 | d3_selectionPrototype.empty = function() { 2 | return !this.node(); 3 | }; 4 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-enter-select.js: -------------------------------------------------------------------------------- 1 | d3_selection_enterPrototype.select = function(selector) { 2 | var subgroups = [], 3 | subgroup, 4 | subnode, 5 | upgroup, 6 | group, 7 | node; 8 | 9 | for (var j = -1, m = this.length; ++j < m;) { 10 | upgroup = (group = this[j]).update; 11 | subgroups.push(subgroup = []); 12 | subgroup.parentNode = group.parentNode; 13 | for (var i = -1, n = group.length; ++i < n;) { 14 | if (node = group[i]) { 15 | subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i)); 16 | subnode.__data__ = node.__data__; 17 | } else { 18 | subgroup.push(null); 19 | } 20 | } 21 | } 22 | 23 | return d3_selection(subgroups); 24 | }; 25 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-enter.js: -------------------------------------------------------------------------------- 1 | function d3_selection_enter(selection) { 2 | d3_arraySubclass(selection, d3_selection_enterPrototype); 3 | return selection; 4 | } 5 | 6 | var d3_selection_enterPrototype = []; 7 | 8 | d3_selection_enterPrototype.append = d3_selectionPrototype.append; 9 | d3_selection_enterPrototype.insert = d3_selectionPrototype.insert; 10 | d3_selection_enterPrototype.empty = d3_selectionPrototype.empty; 11 | d3_selection_enterPrototype.node = d3_selectionPrototype.node; 12 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-filter.js: -------------------------------------------------------------------------------- 1 | d3_selectionPrototype.filter = function(filter) { 2 | var subgroups = [], 3 | subgroup, 4 | group, 5 | node; 6 | 7 | if (typeof filter !== "function") filter = d3_selection_filter(filter); 8 | 9 | for (var j = 0, m = this.length; j < m; j++) { 10 | subgroups.push(subgroup = []); 11 | subgroup.parentNode = (group = this[j]).parentNode; 12 | for (var i = 0, n = group.length; i < n; i++) { 13 | if ((node = group[i]) && filter.call(node, node.__data__, i)) { 14 | subgroup.push(node); 15 | } 16 | } 17 | } 18 | 19 | return d3_selection(subgroups); 20 | }; 21 | 22 | function d3_selection_filter(selector) { 23 | return function() { 24 | return d3_selectMatches(this, selector); 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-html.js: -------------------------------------------------------------------------------- 1 | d3_selectionPrototype.html = function(value) { 2 | return arguments.length < 1 3 | ? this.node().innerHTML : this.each(typeof value === "function" 4 | ? function() { var v = value.apply(this, arguments); this.innerHTML = v == null ? "" : v; } : value == null 5 | ? function() { this.innerHTML = ""; } 6 | : function() { this.innerHTML = value; }); 7 | }; 8 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-insert.js: -------------------------------------------------------------------------------- 1 | // TODO insert(node, function)? 2 | // TODO insert(function, string)? 3 | // TODO insert(function, function)? 4 | d3_selectionPrototype.insert = function(name, before) { 5 | name = d3.ns.qualify(name); 6 | 7 | function insert() { 8 | return this.insertBefore( 9 | document.createElementNS(this.namespaceURI, name), 10 | d3_select(before, this)); 11 | } 12 | 13 | function insertNS() { 14 | return this.insertBefore( 15 | document.createElementNS(name.space, name.local), 16 | d3_select(before, this)); 17 | } 18 | 19 | return this.select(name.local ? insertNS : insert); 20 | }; 21 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-map.js: -------------------------------------------------------------------------------- 1 | d3_selectionPrototype.map = function(map) { 2 | return this.each(function() { 3 | this.__data__ = map.apply(this, arguments); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-node.js: -------------------------------------------------------------------------------- 1 | d3_selectionPrototype.node = function(callback) { 2 | for (var j = 0, m = this.length; j < m; j++) { 3 | for (var group = this[j], i = 0, n = group.length; i < n; i++) { 4 | var node = group[i]; 5 | if (node) return node; 6 | } 7 | } 8 | return null; 9 | }; 10 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-order.js: -------------------------------------------------------------------------------- 1 | d3_selectionPrototype.order = function() { 2 | for (var j = -1, m = this.length; ++j < m;) { 3 | for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0;) { 4 | if (node = group[i]) { 5 | if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next); 6 | next = node; 7 | } 8 | } 9 | } 10 | return this; 11 | }; 12 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-property.js: -------------------------------------------------------------------------------- 1 | d3_selectionPrototype.property = function(name, value) { 2 | 3 | // If no value is specified, return the first value. 4 | if (arguments.length < 2) return this.node()[name]; 5 | 6 | function propertyNull() { 7 | delete this[name]; 8 | } 9 | 10 | function propertyConstant() { 11 | this[name] = value; 12 | } 13 | 14 | function propertyFunction() { 15 | var x = value.apply(this, arguments); 16 | if (x == null) delete this[name]; 17 | else this[name] = x; 18 | } 19 | 20 | return this.each(value == null 21 | ? propertyNull : (typeof value === "function" 22 | ? propertyFunction : propertyConstant)); 23 | }; 24 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-remove.js: -------------------------------------------------------------------------------- 1 | // TODO remove(selector)? 2 | // TODO remove(node)? 3 | // TODO remove(function)? 4 | d3_selectionPrototype.remove = function() { 5 | return this.each(function() { 6 | var parent = this.parentNode; 7 | if (parent) parent.removeChild(this); 8 | }); 9 | }; 10 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-root.js: -------------------------------------------------------------------------------- 1 | var d3_selectionRoot = d3_selection([[document]]); 2 | 3 | d3_selectionRoot[0].parentNode = d3_selectRoot; 4 | 5 | // TODO fast singleton implementation! 6 | // TODO select(function) 7 | d3.select = function(selector) { 8 | return typeof selector === "string" 9 | ? d3_selectionRoot.select(selector) 10 | : d3_selection([[selector]]); // assume node 11 | }; 12 | 13 | // TODO selectAll(function) 14 | d3.selectAll = function(selector) { 15 | return typeof selector === "string" 16 | ? d3_selectionRoot.selectAll(selector) 17 | : d3_selection([d3_array(selector)]); // assume node[] 18 | }; 19 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-select.js: -------------------------------------------------------------------------------- 1 | d3_selectionPrototype.select = function(selector) { 2 | var subgroups = [], 3 | subgroup, 4 | subnode, 5 | group, 6 | node; 7 | 8 | if (typeof selector !== "function") selector = d3_selection_selector(selector); 9 | 10 | for (var j = -1, m = this.length; ++j < m;) { 11 | subgroups.push(subgroup = []); 12 | subgroup.parentNode = (group = this[j]).parentNode; 13 | for (var i = -1, n = group.length; ++i < n;) { 14 | if (node = group[i]) { 15 | subgroup.push(subnode = selector.call(node, node.__data__, i)); 16 | if (subnode && "__data__" in node) subnode.__data__ = node.__data__; 17 | } else { 18 | subgroup.push(null); 19 | } 20 | } 21 | } 22 | 23 | return d3_selection(subgroups); 24 | }; 25 | 26 | function d3_selection_selector(selector) { 27 | return function() { 28 | return d3_select(selector, this); 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-selectAll.js: -------------------------------------------------------------------------------- 1 | d3_selectionPrototype.selectAll = function(selector) { 2 | var subgroups = [], 3 | subgroup, 4 | node; 5 | 6 | if (typeof selector !== "function") selector = d3_selection_selectorAll(selector); 7 | 8 | for (var j = -1, m = this.length; ++j < m;) { 9 | for (var group = this[j], i = -1, n = group.length; ++i < n;) { 10 | if (node = group[i]) { 11 | subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i))); 12 | subgroup.parentNode = node; 13 | } 14 | } 15 | } 16 | 17 | return d3_selection(subgroups); 18 | }; 19 | 20 | function d3_selection_selectorAll(selector) { 21 | return function() { 22 | return d3_selectAll(selector, this); 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-sort.js: -------------------------------------------------------------------------------- 1 | d3_selectionPrototype.sort = function(comparator) { 2 | comparator = d3_selection_sortComparator.apply(this, arguments); 3 | for (var j = -1, m = this.length; ++j < m;) this[j].sort(comparator); 4 | return this.order(); 5 | }; 6 | 7 | function d3_selection_sortComparator(comparator) { 8 | if (!arguments.length) comparator = d3.ascending; 9 | return function(a, b) { 10 | return comparator(a && a.__data__, b && b.__data__); 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-style.js: -------------------------------------------------------------------------------- 1 | d3_selectionPrototype.style = function(name, value, priority) { 2 | if (arguments.length < 3) priority = ""; 3 | 4 | // If no value is specified, return the first value. 5 | if (arguments.length < 2) return window 6 | .getComputedStyle(this.node(), null) 7 | .getPropertyValue(name); 8 | 9 | function styleNull() { 10 | this.style.removeProperty(name); 11 | } 12 | 13 | function styleConstant() { 14 | this.style.setProperty(name, value, priority); 15 | } 16 | 17 | function styleFunction() { 18 | var x = value.apply(this, arguments); 19 | if (x == null) this.style.removeProperty(name); 20 | else this.style.setProperty(name, x, priority); 21 | } 22 | 23 | return this.each(value == null 24 | ? styleNull : (typeof value === "function" 25 | ? styleFunction : styleConstant)); 26 | }; 27 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-text.js: -------------------------------------------------------------------------------- 1 | d3_selectionPrototype.text = function(value) { 2 | return arguments.length < 1 3 | ? this.node().textContent : this.each(typeof value === "function" 4 | ? function() { var v = value.apply(this, arguments); this.textContent = v == null ? "" : v; } : value == null 5 | ? function() { this.textContent = ""; } 6 | : function() { this.textContent = value; }); 7 | }; 8 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/selection-transition.js: -------------------------------------------------------------------------------- 1 | d3_selectionPrototype.transition = function() { 2 | var subgroups = [], 3 | subgroup, 4 | node; 5 | 6 | for (var j = -1, m = this.length; ++j < m;) { 7 | subgroups.push(subgroup = []); 8 | for (var group = this[j], i = -1, n = group.length; ++i < n;) { 9 | subgroup.push((node = group[i]) ? {node: node, delay: 0, duration: 250} : null); 10 | } 11 | } 12 | 13 | return d3_transition(subgroups, d3_transitionInheritId || ++d3_transitionId, Date.now()); 14 | }; 15 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/split.js: -------------------------------------------------------------------------------- 1 | d3.split = function(array, f) { 2 | var arrays = [], 3 | values = [], 4 | value, 5 | i = -1, 6 | n = array.length; 7 | if (arguments.length < 2) f = d3_splitter; 8 | while (++i < n) { 9 | if (f.call(values, value = array[i], i)) { 10 | values = []; 11 | } else { 12 | if (!values.length) arrays.push(values); 13 | values.push(value); 14 | } 15 | } 16 | return arrays; 17 | }; 18 | 19 | function d3_splitter(d) { 20 | return d == null; 21 | } 22 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/sum.js: -------------------------------------------------------------------------------- 1 | d3.sum = function(array, f) { 2 | var s = 0, 3 | n = array.length, 4 | a, 5 | i = -1; 6 | 7 | if (arguments.length === 1) { 8 | while (++i < n) if (!isNaN(a = +array[i])) s += a; 9 | } else { 10 | while (++i < n) if (!isNaN(a = +f.call(array, array[i], i))) s += a; 11 | } 12 | 13 | return s; 14 | }; 15 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/text.js: -------------------------------------------------------------------------------- 1 | d3.text = function(url, mime, callback) { 2 | function ready(req) { 3 | callback(req && req.responseText); 4 | } 5 | if (arguments.length < 3) { 6 | callback = mime; 7 | mime = null; 8 | } 9 | d3.xhr(url, mime, ready); 10 | }; 11 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/this.js: -------------------------------------------------------------------------------- 1 | function d3_this() { 2 | return this; 3 | } 4 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/transition-attr.js: -------------------------------------------------------------------------------- 1 | d3_transitionPrototype.attr = function(name, value) { 2 | return this.attrTween(name, d3_transitionTween(name, value)); 3 | }; 4 | 5 | d3_transitionPrototype.attrTween = function(nameNS, tween) { 6 | var name = d3.ns.qualify(nameNS); 7 | 8 | function attrTween(d, i) { 9 | var f = tween.call(this, d, i, this.getAttribute(name)); 10 | return f === d3_transitionRemove 11 | ? (this.removeAttribute(name), null) 12 | : f && function(t) { this.setAttribute(name, f(t)); }; 13 | } 14 | 15 | function attrTweenNS(d, i) { 16 | var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local)); 17 | return f === d3_transitionRemove 18 | ? (this.removeAttributeNS(name.space, name.local), null) 19 | : f && function(t) { this.setAttributeNS(name.space, name.local, f(t)); }; 20 | } 21 | 22 | return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween); 23 | }; 24 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/transition-delay.js: -------------------------------------------------------------------------------- 1 | d3_transitionPrototype.delay = function(value) { 2 | var groups = this; 3 | return groups.each(typeof value === "function" 4 | ? function(d, i, j) { groups[j][i].delay = +value.apply(this, arguments); } 5 | : (value = +value, function(d, i, j) { groups[j][i].delay = value; })); 6 | }; 7 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/transition-duration.js: -------------------------------------------------------------------------------- 1 | d3_transitionPrototype.duration = function(value) { 2 | var groups = this; 3 | return groups.each(typeof value === "function" 4 | ? function(d, i, j) { groups[j][i].duration = +value.apply(this, arguments); } 5 | : (value = +value, function(d, i, j) { groups[j][i].duration = value; })); 6 | }; 7 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/transition-each.js: -------------------------------------------------------------------------------- 1 | function d3_transition_each(callback) { 2 | for (var j = 0, m = this.length; j < m; j++) { 3 | for (var group = this[j], i = 0, n = group.length; i < n; i++) { 4 | var node = group[i]; 5 | if (node) callback.call(node = node.node, node.__data__, i, j); 6 | } 7 | } 8 | return this; 9 | } 10 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/transition-remove.js: -------------------------------------------------------------------------------- 1 | d3_transitionPrototype.remove = function() { 2 | return this.each("end.transition", function() { 3 | var p; 4 | if (!this.__transition__ && (p = this.parentNode)) p.removeChild(this); 5 | }); 6 | }; 7 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/transition-select.js: -------------------------------------------------------------------------------- 1 | d3_transitionPrototype.select = function(selector) { 2 | var subgroups = [], 3 | subgroup, 4 | subnode, 5 | node; 6 | 7 | if (typeof selector !== "function") selector = d3_selection_selector(selector); 8 | 9 | for (var j = -1, m = this.length; ++j < m;) { 10 | subgroups.push(subgroup = []); 11 | for (var group = this[j], i = -1, n = group.length; ++i < n;) { 12 | if ((node = group[i]) && (subnode = selector.call(node.node, node.node.__data__, i))) { 13 | if ("__data__" in node.node) subnode.__data__ = node.node.__data__; 14 | subgroup.push({node: subnode, delay: node.delay, duration: node.duration}); 15 | } else { 16 | subgroup.push(null); 17 | } 18 | } 19 | } 20 | 21 | return d3_transition(subgroups, this.id, this.time).ease(this.ease()); 22 | }; 23 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/transition-selectAll.js: -------------------------------------------------------------------------------- 1 | d3_transitionPrototype.selectAll = function(selector) { 2 | var subgroups = [], 3 | subgroup, 4 | subnodes, 5 | node; 6 | 7 | if (typeof selector !== "function") selector = d3_selection_selectorAll(selector); 8 | 9 | for (var j = -1, m = this.length; ++j < m;) { 10 | for (var group = this[j], i = -1, n = group.length; ++i < n;) { 11 | if (node = group[i]) { 12 | subnodes = selector.call(node.node, node.node.__data__, i); 13 | subgroups.push(subgroup = []); 14 | for (var k = -1, o = subnodes.length; ++k < o;) { 15 | subgroup.push({node: subnodes[k], delay: node.delay, duration: node.duration}); 16 | } 17 | } 18 | } 19 | } 20 | 21 | return d3_transition(subgroups, this.id, this.time).ease(this.ease()); 22 | }; 23 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/transition-style.js: -------------------------------------------------------------------------------- 1 | d3_transitionPrototype.style = function(name, value, priority) { 2 | if (arguments.length < 3) priority = ""; 3 | return this.styleTween(name, d3_transitionTween(name, value), priority); 4 | }; 5 | 6 | d3_transitionPrototype.styleTween = function(name, tween, priority) { 7 | if (arguments.length < 3) priority = ""; 8 | return this.tween("style." + name, function(d, i) { 9 | var f = tween.call(this, d, i, window.getComputedStyle(this, null).getPropertyValue(name)); 10 | return f === d3_transitionRemove 11 | ? (this.style.removeProperty(name), null) 12 | : f && function(t) { this.style.setProperty(name, f(t), priority); }; 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/transition-text.js: -------------------------------------------------------------------------------- 1 | d3_transitionPrototype.text = function(value) { 2 | return this.tween("text", function(d, i) { 3 | this.textContent = typeof value === "function" 4 | ? value.call(this, d, i) 5 | : value; 6 | }); 7 | }; 8 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/transition-transition.js: -------------------------------------------------------------------------------- 1 | d3_transitionPrototype.transition = function() { 2 | return this.select(d3_this); 3 | }; 4 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/transpose.js: -------------------------------------------------------------------------------- 1 | d3.transpose = function(matrix) { 2 | return d3.zip.apply(d3, matrix); 3 | }; 4 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/uninterpolate.js: -------------------------------------------------------------------------------- 1 | function d3_uninterpolateNumber(a, b) { 2 | b = b - (a = +a) ? 1 / (b - a) : 0; 3 | return function(x) { return (x - a) * b; }; 4 | } 5 | 6 | function d3_uninterpolateClamp(a, b) { 7 | b = b - (a = +a) ? 1 / (b - a) : 0; 8 | return function(x) { return Math.max(0, Math.min(1, (x - a) * b)); }; 9 | } 10 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/values.js: -------------------------------------------------------------------------------- 1 | d3.values = function(map) { 2 | var values = []; 3 | for (var key in map) values.push(map[key]); 4 | return values; 5 | }; 6 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/xhr.js: -------------------------------------------------------------------------------- 1 | d3.xhr = function(url, mime, callback) { 2 | var req = new XMLHttpRequest; 3 | if (arguments.length < 3) callback = mime, mime = null; 4 | else if (mime && req.overrideMimeType) req.overrideMimeType(mime); 5 | req.open("GET", url, true); 6 | if (mime) req.setRequestHeader("Accept", mime); 7 | req.onreadystatechange = function() { 8 | if (req.readyState === 4) callback(req.status < 300 ? req : null); 9 | }; 10 | req.send(null); 11 | }; 12 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/xml.js: -------------------------------------------------------------------------------- 1 | d3.xml = function(url, mime, callback) { 2 | function ready(req) { 3 | callback(req && req.responseXML); 4 | } 5 | if (arguments.length < 3) { 6 | callback = mime; 7 | mime = null; 8 | } 9 | d3.xhr(url, mime, ready); 10 | }; 11 | -------------------------------------------------------------------------------- /vis/lib/d3/src/core/zip.js: -------------------------------------------------------------------------------- 1 | d3.zip = function() { 2 | if (!(n = arguments.length)) return []; 3 | for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m;) { 4 | for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n;) { 5 | zip[j] = arguments[j][i]; 6 | } 7 | } 8 | return zips; 9 | }; 10 | 11 | function d3_zipLength(d) { 12 | return d.length; 13 | } 14 | -------------------------------------------------------------------------------- /vis/lib/d3/src/csv/csv.js: -------------------------------------------------------------------------------- 1 | d3.csv = function(url, callback) { 2 | d3.text(url, "text/csv", function(text) { 3 | callback(text && d3.csv.parse(text)); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /vis/lib/d3/src/csv/format.js: -------------------------------------------------------------------------------- 1 | d3.csv.format = function(rows) { 2 | return rows.map(d3_csv_formatRow).join("\n"); 3 | }; 4 | 5 | function d3_csv_formatRow(row) { 6 | return row.map(d3_csv_formatValue).join(","); 7 | } 8 | 9 | function d3_csv_formatValue(text) { 10 | return /[",\n]/.test(text) 11 | ? "\"" + text.replace(/\"/g, "\"\"") + "\"" 12 | : text; 13 | } 14 | -------------------------------------------------------------------------------- /vis/lib/d3/src/end.js: -------------------------------------------------------------------------------- 1 | })(); 2 | -------------------------------------------------------------------------------- /vis/lib/d3/src/externs.js: -------------------------------------------------------------------------------- 1 | // JavaScript built-ins. 2 | var console, 3 | JSON; 4 | 5 | // d3 6 | var d3; 7 | -------------------------------------------------------------------------------- /vis/lib/d3/src/geo/equirectangular.js: -------------------------------------------------------------------------------- 1 | d3.geo.equirectangular = function() { 2 | var scale = 500, 3 | translate = [480, 250]; 4 | 5 | function equirectangular(coordinates) { 6 | var x = coordinates[0] / 360, 7 | y = -coordinates[1] / 360; 8 | return [ 9 | scale * x + translate[0], 10 | scale * y + translate[1] 11 | ]; 12 | } 13 | 14 | equirectangular.invert = function(coordinates) { 15 | var x = (coordinates[0] - translate[0]) / scale, 16 | y = (coordinates[1] - translate[1]) / scale; 17 | return [ 18 | 360 * x, 19 | -360 * y 20 | ]; 21 | }; 22 | 23 | equirectangular.scale = function(x) { 24 | if (!arguments.length) return scale; 25 | scale = +x; 26 | return equirectangular; 27 | }; 28 | 29 | equirectangular.translate = function(x) { 30 | if (!arguments.length) return translate; 31 | translate = [+x[0], +x[1]]; 32 | return equirectangular; 33 | }; 34 | 35 | return equirectangular; 36 | }; 37 | -------------------------------------------------------------------------------- /vis/lib/d3/src/geo/geo.js: -------------------------------------------------------------------------------- 1 | d3.geo = {}; 2 | 3 | var d3_geo_radians = Math.PI / 180; 4 | -------------------------------------------------------------------------------- /vis/lib/d3/src/geo/greatCircle.js: -------------------------------------------------------------------------------- 1 | d3.geo.greatCircle = d3.geo.circle; 2 | -------------------------------------------------------------------------------- /vis/lib/d3/src/geo/type.js: -------------------------------------------------------------------------------- 1 | function d3_geo_type(types, defaultValue) { 2 | return function(object) { 3 | return object && object.type in types ? types[object.type](object) : defaultValue; 4 | }; 5 | } 6 | -------------------------------------------------------------------------------- /vis/lib/d3/src/geom/delaunay.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param vertices [[x1, y1], [x2, y2], …] 3 | * @returns triangles [[[x1, y1], [x2, y2], [x3, y3]], …] 4 | */ 5 | d3.geom.delaunay = function(vertices) { 6 | var edges = vertices.map(function() { return []; }), 7 | triangles = []; 8 | 9 | // Use the Voronoi tessellation to determine Delaunay edges. 10 | d3_voronoi_tessellate(vertices, function(e) { 11 | edges[e.region.l.index].push(vertices[e.region.r.index]); 12 | }); 13 | 14 | // Reconnect the edges into counterclockwise triangles. 15 | edges.forEach(function(edge, i) { 16 | var v = vertices[i], 17 | cx = v[0], 18 | cy = v[1]; 19 | edge.forEach(function(v) { 20 | v.angle = Math.atan2(v[0] - cx, v[1] - cy); 21 | }); 22 | edge.sort(function(a, b) { 23 | return a.angle - b.angle; 24 | }); 25 | for (var j = 0, m = edge.length - 1; j < m; j++) { 26 | triangles.push([v, edge[j], edge[j + 1]]); 27 | } 28 | }); 29 | 30 | return triangles; 31 | }; 32 | -------------------------------------------------------------------------------- /vis/lib/d3/src/geom/geom.js: -------------------------------------------------------------------------------- 1 | d3.geom = {}; 2 | -------------------------------------------------------------------------------- /vis/lib/d3/src/layout/layout.js: -------------------------------------------------------------------------------- 1 | d3.layout = {}; 2 | -------------------------------------------------------------------------------- /vis/lib/d3/src/package.js: -------------------------------------------------------------------------------- 1 | require("../test/env"); 2 | require("../d3"); 3 | 4 | require("util").puts(JSON.stringify({ 5 | "name": "d3", 6 | "version": d3.version, 7 | "description": "A small, free JavaScript library for manipulating documents based on data.", 8 | "keywords": ["dom", "w3c", "visualization", "svg", "animation", "canvas"], 9 | "homepage": "http://mbostock.github.com/d3/", 10 | "author": {"name": "Mike Bostock", "url": "http://bost.ocks.org/mike"}, 11 | "repository": {"type": "git", "url": "http://github.com/mbostock/d3.git"}, 12 | "main": "d3.js", 13 | "dependencies": { 14 | "jsdom": "0.2.10" 15 | }, 16 | "devDependencies": { 17 | "uglify-js": "1.2.3", 18 | "vows": "0.6.x" 19 | }, 20 | "scripts": {"test": "./node_modules/vows/bin/vows"} 21 | }, null, 2)); 22 | -------------------------------------------------------------------------------- /vis/lib/d3/src/scale/bilinear.js: -------------------------------------------------------------------------------- 1 | function d3_scale_bilinear(domain, range, uninterpolate, interpolate) { 2 | var u = uninterpolate(domain[0], domain[1]), 3 | i = interpolate(range[0], range[1]); 4 | return function(x) { 5 | return i(u(x)); 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /vis/lib/d3/src/scale/nice.js: -------------------------------------------------------------------------------- 1 | function d3_scale_nice(domain, nice) { 2 | var i0 = 0, 3 | i1 = domain.length - 1, 4 | x0 = domain[i0], 5 | x1 = domain[i1], 6 | dx; 7 | 8 | if (x1 < x0) { 9 | dx = i0; i0 = i1; i1 = dx; 10 | dx = x0; x0 = x1; x1 = dx; 11 | } 12 | 13 | if (dx = x1 - x0) { 14 | nice = nice(dx); 15 | domain[i0] = nice.floor(x0); 16 | domain[i1] = nice.ceil(x1); 17 | } 18 | 19 | return domain; 20 | } 21 | 22 | function d3_scale_niceDefault() { 23 | return Math; 24 | } 25 | -------------------------------------------------------------------------------- /vis/lib/d3/src/scale/polylinear.js: -------------------------------------------------------------------------------- 1 | function d3_scale_polylinear(domain, range, uninterpolate, interpolate) { 2 | var u = [], 3 | i = [], 4 | j = 0, 5 | k = domain.length - 1; 6 | 7 | // Handle descending domains. 8 | if (domain[k] < domain[0]) { 9 | domain = domain.slice().reverse(); 10 | range = range.slice().reverse(); 11 | } 12 | 13 | while (++j <= k) { 14 | u.push(uninterpolate(domain[j - 1], domain[j])); 15 | i.push(interpolate(range[j - 1], range[j])); 16 | } 17 | 18 | return function(x) { 19 | var j = d3.bisect(domain, x, 1, k) - 1; 20 | return i[j](u[j](x)); 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /vis/lib/d3/src/scale/quantize.js: -------------------------------------------------------------------------------- 1 | d3.scale.quantize = function() { 2 | return d3_scale_quantize(0, 1, [0, 1]); 3 | }; 4 | 5 | function d3_scale_quantize(x0, x1, range) { 6 | var kx, i; 7 | 8 | function scale(x) { 9 | return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))]; 10 | } 11 | 12 | function rescale() { 13 | kx = range.length / (x1 - x0); 14 | i = range.length - 1; 15 | return scale; 16 | } 17 | 18 | scale.domain = function(x) { 19 | if (!arguments.length) return [x0, x1]; 20 | x0 = +x[0]; 21 | x1 = +x[x.length - 1]; 22 | return rescale(); 23 | }; 24 | 25 | scale.range = function(x) { 26 | if (!arguments.length) return range; 27 | range = x; 28 | return rescale(); 29 | }; 30 | 31 | scale.copy = function() { 32 | return d3_scale_quantize(x0, x1, range); // copy on write 33 | }; 34 | 35 | return rescale(); 36 | }; 37 | -------------------------------------------------------------------------------- /vis/lib/d3/src/scale/scale.js: -------------------------------------------------------------------------------- 1 | d3.scale = {}; 2 | 3 | function d3_scaleExtent(domain) { 4 | var start = domain[0], stop = domain[domain.length - 1]; 5 | return start < stop ? [start, stop] : [stop, start]; 6 | } 7 | 8 | function d3_scaleRange(scale) { 9 | return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range()); 10 | } 11 | -------------------------------------------------------------------------------- /vis/lib/d3/src/scale/sqrt.js: -------------------------------------------------------------------------------- 1 | d3.scale.sqrt = function() { 2 | return d3.scale.pow().exponent(.5); 3 | }; 4 | -------------------------------------------------------------------------------- /vis/lib/d3/src/start.js: -------------------------------------------------------------------------------- 1 | (function(){ -------------------------------------------------------------------------------- /vis/lib/d3/src/svg/area-radial.js: -------------------------------------------------------------------------------- 1 | d3.svg.area.radial = function() { 2 | var area = d3_svg_area(d3_svg_lineRadial); 3 | area.radius = area.x, delete area.x; 4 | area.innerRadius = area.x0, delete area.x0; 5 | area.outerRadius = area.x1, delete area.x1; 6 | area.angle = area.y, delete area.y; 7 | area.startAngle = area.y0, delete area.y0; 8 | area.endAngle = area.y1, delete area.y1; 9 | return area; 10 | }; 11 | -------------------------------------------------------------------------------- /vis/lib/d3/src/svg/diagonal-radial.js: -------------------------------------------------------------------------------- 1 | d3.svg.diagonal.radial = function() { 2 | var diagonal = d3.svg.diagonal(), 3 | projection = d3_svg_diagonalProjection, 4 | projection_ = diagonal.projection; 5 | 6 | diagonal.projection = function(x) { 7 | return arguments.length 8 | ? projection_(d3_svg_diagonalRadialProjection(projection = x)) 9 | : projection; 10 | }; 11 | 12 | return diagonal; 13 | }; 14 | 15 | function d3_svg_diagonalRadialProjection(projection) { 16 | return function() { 17 | var d = projection.apply(this, arguments), 18 | r = d[0], 19 | a = d[1] + d3_svg_arcOffset; 20 | return [r * Math.cos(a), r * Math.sin(a)]; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /vis/lib/d3/src/svg/line-radial.js: -------------------------------------------------------------------------------- 1 | d3.svg.line.radial = function() { 2 | var line = d3_svg_line(d3_svg_lineRadial); 3 | line.radius = line.x, delete line.x; 4 | line.angle = line.y, delete line.y; 5 | return line; 6 | }; 7 | 8 | function d3_svg_lineRadial(points) { 9 | var point, 10 | i = -1, 11 | n = points.length, 12 | r, 13 | a; 14 | while (++i < n) { 15 | point = points[i]; 16 | r = point[0]; 17 | a = point[1] + d3_svg_arcOffset; 18 | point[0] = r * Math.cos(a); 19 | point[1] = r * Math.sin(a); 20 | } 21 | return points; 22 | } 23 | -------------------------------------------------------------------------------- /vis/lib/d3/src/svg/svg.js: -------------------------------------------------------------------------------- 1 | d3.svg = {}; 2 | -------------------------------------------------------------------------------- /vis/lib/d3/src/svg/touches.js: -------------------------------------------------------------------------------- 1 | d3.svg.touches = function(container, touches) { 2 | if (arguments.length < 2) touches = d3.event.touches; 3 | 4 | return touches ? d3_array(touches).map(function(touch) { 5 | var point = d3_svg_mousePoint(container, touch); 6 | point.identifier = touch.identifier; 7 | return point; 8 | }) : []; 9 | }; 10 | -------------------------------------------------------------------------------- /vis/lib/d3/src/time/day.js: -------------------------------------------------------------------------------- 1 | d3.time.day = function(date) { 2 | return new Date(date.getFullYear(), date.getMonth(), date.getDate()); 3 | }; 4 | 5 | d3.time.day.utc = function(date) { 6 | return new Date(~~(date / 864e5) * 864e5); 7 | }; 8 | -------------------------------------------------------------------------------- /vis/lib/d3/src/time/days.js: -------------------------------------------------------------------------------- 1 | d3.time.days = d3_time_range(d3.time.day, function(date) { 2 | date.setDate(date.getDate() + 1); 3 | }, function(date) { 4 | return date.getDate() - 1; 5 | }); 6 | 7 | d3.time.days.utc = d3_time_range(d3.time.day.utc, function(date) { 8 | date.setUTCDate(date.getUTCDate() + 1); 9 | }, function(date) { 10 | return date.getUTCDate() - 1; 11 | }); 12 | -------------------------------------------------------------------------------- /vis/lib/d3/src/time/format-iso.js: -------------------------------------------------------------------------------- 1 | var d3_time_formatIso = d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ"); 2 | 3 | d3.time.format.iso = Date.prototype.toISOString ? d3_time_formatIsoNative : d3_time_formatIso; 4 | 5 | function d3_time_formatIsoNative(date) { 6 | return date.toISOString(); 7 | } 8 | 9 | d3_time_formatIsoNative.parse = function(string) { 10 | return new Date(string); 11 | }; 12 | 13 | d3_time_formatIsoNative.toString = d3_time_formatIso.toString; 14 | -------------------------------------------------------------------------------- /vis/lib/d3/src/time/hour.js: -------------------------------------------------------------------------------- 1 | d3.time.hour = function(date) { 2 | var offset = date.getTimezoneOffset() / 60; 3 | return new Date((~~(date / 36e5 - offset) + offset) * 36e5); 4 | }; 5 | 6 | d3.time.hour.utc = function(date) { 7 | return new Date(~~(date / 36e5) * 36e5); 8 | }; 9 | -------------------------------------------------------------------------------- /vis/lib/d3/src/time/hours.js: -------------------------------------------------------------------------------- 1 | d3.time.hours = d3_time_range(d3.time.hour, d3_time_hoursStep, function(date) { 2 | return date.getHours(); 3 | }); 4 | 5 | d3.time.hours.utc = d3_time_range(d3.time.hour.utc, d3_time_hoursStep, function(date) { 6 | return date.getUTCHours(); 7 | }); 8 | 9 | function d3_time_hoursStep(date) { 10 | date.setTime(date.getTime() + 36e5); 11 | } 12 | -------------------------------------------------------------------------------- /vis/lib/d3/src/time/minute.js: -------------------------------------------------------------------------------- 1 | d3.time.minute = function(date) { 2 | return new Date(~~(date / 6e4) * 6e4); 3 | }; 4 | 5 | d3.time.minute.utc = d3.time.minute; -------------------------------------------------------------------------------- /vis/lib/d3/src/time/minutes.js: -------------------------------------------------------------------------------- 1 | d3.time.minutes = d3_time_range(d3.time.minute, d3_time_minutesStep, function(date) { 2 | return date.getMinutes(); 3 | }); 4 | 5 | d3.time.minutes.utc = d3_time_range(d3.time.minute, d3_time_minutesStep, function(date) { 6 | return date.getUTCMinutes(); 7 | }); 8 | 9 | function d3_time_minutesStep(date) { 10 | date.setTime(date.getTime() + 6e4); // assumes no leap seconds 11 | } 12 | -------------------------------------------------------------------------------- /vis/lib/d3/src/time/month.js: -------------------------------------------------------------------------------- 1 | d3.time.month = function(date) { 2 | return new Date(date.getFullYear(), date.getMonth(), 1); 3 | }; 4 | 5 | d3.time.month.utc = function(date) { 6 | return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1)); 7 | }; 8 | -------------------------------------------------------------------------------- /vis/lib/d3/src/time/months.js: -------------------------------------------------------------------------------- 1 | d3.time.months = d3_time_range(d3.time.month, function(date) { 2 | date.setMonth(date.getMonth() + 1); 3 | }, function(date) { 4 | return date.getMonth(); 5 | }); 6 | 7 | d3.time.months.utc = d3_time_range(d3.time.month.utc, function(date) { 8 | date.setUTCMonth(date.getUTCMonth() + 1); 9 | }, function(date) { 10 | return date.getUTCMonth(); 11 | }); 12 | -------------------------------------------------------------------------------- /vis/lib/d3/src/time/range.js: -------------------------------------------------------------------------------- 1 | function d3_time_range(floor, step, number) { 2 | return function(t0, t1, dt) { 3 | var time = floor(t0), times = []; 4 | if (time < t0) step(time); 5 | if (dt > 1) { 6 | while (time < t1) { 7 | var date = new Date(+time); 8 | if (!(number(date) % dt)) times.push(date); 9 | step(time); 10 | } 11 | } else { 12 | while (time < t1) times.push(new Date(+time)), step(time); 13 | } 14 | return times; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /vis/lib/d3/src/time/second.js: -------------------------------------------------------------------------------- 1 | d3.time.second = function(date) { 2 | return new Date(~~(date / 1e3) * 1e3); 3 | }; 4 | 5 | d3.time.second.utc = d3.time.second; 6 | -------------------------------------------------------------------------------- /vis/lib/d3/src/time/seconds.js: -------------------------------------------------------------------------------- 1 | d3.time.seconds = d3_time_range(d3.time.second, function(date) { 2 | date.setTime(date.getTime() + 1e3); 3 | }, function(date) { 4 | return date.getSeconds(); 5 | }); 6 | 7 | d3.time.seconds.utc = d3.time.seconds; 8 | -------------------------------------------------------------------------------- /vis/lib/d3/src/time/time.js: -------------------------------------------------------------------------------- 1 | d3.time = {}; 2 | 3 | var d3_time = Date; 4 | -------------------------------------------------------------------------------- /vis/lib/d3/src/time/week.js: -------------------------------------------------------------------------------- 1 | d3.time.week = function(date) { 2 | (date = d3.time.day(date)).setDate(date.getDate() - date.getDay()); 3 | return date; 4 | }; 5 | 6 | d3.time.week.utc = function(date) { 7 | (date = d3.time.day.utc(date)).setUTCDate(date.getUTCDate() - date.getUTCDay()); 8 | return date; 9 | }; 10 | -------------------------------------------------------------------------------- /vis/lib/d3/src/time/weeks.js: -------------------------------------------------------------------------------- 1 | d3.time.weeks = d3_time_range(d3.time.week, function(date) { 2 | date.setDate(date.getDate() + 7); 3 | }, function(date) { 4 | return ~~((date - new Date(date.getFullYear(), 0, 1)) / 6048e5); 5 | }); 6 | 7 | d3.time.weeks.utc = d3_time_range(d3.time.week.utc, function(date) { 8 | date.setUTCDate(date.getUTCDate() + 7); 9 | }, function(date) { 10 | return ~~((date - Date.UTC(date.getUTCFullYear(), 0, 1)) / 6048e5); 11 | }); 12 | -------------------------------------------------------------------------------- /vis/lib/d3/src/time/year.js: -------------------------------------------------------------------------------- 1 | d3.time.year = function(date) { 2 | return new Date(date.getFullYear(), 0, 1); 3 | }; 4 | 5 | d3.time.year.utc = function(date) { 6 | return new Date(Date.UTC(date.getUTCFullYear(), 0, 1)); 7 | }; 8 | -------------------------------------------------------------------------------- /vis/lib/d3/src/time/years.js: -------------------------------------------------------------------------------- 1 | d3.time.years = d3_time_range(d3.time.year, function(date) { 2 | date.setFullYear(date.getFullYear() + 1); 3 | }, function(date) { 4 | return date.getFullYear(); 5 | }); 6 | 7 | d3.time.years.utc = d3_time_range(d3.time.year.utc, function(date) { 8 | date.setUTCFullYear(date.getUTCFullYear() + 1); 9 | }, function(date) { 10 | return date.getUTCFullYear(); 11 | }); 12 | -------------------------------------------------------------------------------- /vis/lib/d3/test/core/functor-test.js: -------------------------------------------------------------------------------- 1 | require("../env"); 2 | require("../../d3"); 3 | 4 | var vows = require("vows"), 5 | assert = require("assert"); 6 | 7 | var suite = vows.describe("d3.functor"); 8 | 9 | suite.addBatch({ 10 | "functor": { 11 | topic: function() { 12 | return d3.functor; 13 | }, 14 | "when passed a function, returns the function": function(functor) { 15 | function foo() {} 16 | assert.strictEqual(functor(foo), foo); 17 | }, 18 | "when passed a non-function, returns a wrapper function": function(functor) { 19 | var a = {}; 20 | assert.isNull(functor(null)()); 21 | assert.isUndefined(functor(undefined)()); 22 | assert.strictEqual(functor(a)(), a); 23 | assert.strictEqual(functor(1)(), 1); 24 | assert.deepEqual(functor([1])(), [1]); 25 | } 26 | } 27 | }); 28 | 29 | suite.export(module); 30 | -------------------------------------------------------------------------------- /vis/lib/d3/test/core/keys-test.js: -------------------------------------------------------------------------------- 1 | require("../env"); 2 | require("../../d3"); 3 | 4 | var vows = require("vows"), 5 | assert = require("assert"); 6 | 7 | var suite = vows.describe("d3.keys"); 8 | 9 | suite.addBatch({ 10 | "keys": { 11 | topic: function() { 12 | return d3.keys; 13 | }, 14 | "enumerates every defined key": function(keys) { 15 | assert.deepEqual(keys({a: 1, b: 1}), ["a", "b"]); 16 | }, 17 | "includes keys defined on prototypes": function(keys) { 18 | function abc() { 19 | this.a = 1; 20 | this.b = 2; 21 | } 22 | abc.prototype.c = 3; 23 | assert.deepEqual(keys(new abc()), ["a", "b", "c"]); 24 | }, 25 | "includes keys with null or undefined values": function(keys) { 26 | assert.deepEqual(keys({a: undefined, b: null, c: NaN}), ["a", "b", "c"]); 27 | } 28 | } 29 | }); 30 | 31 | suite.export(module); 32 | -------------------------------------------------------------------------------- /vis/lib/d3/test/core/merge-test.js: -------------------------------------------------------------------------------- 1 | require("../env"); 2 | require("../../d3"); 3 | 4 | var vows = require("vows"), 5 | assert = require("assert"); 6 | 7 | var suite = vows.describe("d3.merge"); 8 | 9 | suite.addBatch({ 10 | "merge": { 11 | "merges an array of arrays": function() { 12 | var a = {}, b = {}, c = {}, d = {}, e = {}, f = {}; 13 | assert.deepEqual(d3.merge([[a], [b, c], [d, e, f]]), [a, b, c, d, e, f]); 14 | }, 15 | "returns a new array": function() { 16 | var input = [[1, 2, 3], [4, 5], [6]]; 17 | assert.isFalse(d3.merge(input) === input); 18 | }, 19 | "does not modify the input arrays": function() { 20 | var input = [[1, 2, 3], [4, 5], [6]]; 21 | d3.merge(input); 22 | assert.deepEqual(input, [[1, 2, 3], [4, 5], [6]]); 23 | } 24 | } 25 | }); 26 | 27 | suite.export(module); 28 | -------------------------------------------------------------------------------- /vis/lib/d3/test/core/transition-test-id.js: -------------------------------------------------------------------------------- 1 | require("../env"); 2 | require("../../d3"); 3 | 4 | var assert = require("assert"); 5 | 6 | module.exports = { 7 | topic: function() { 8 | return d3.select("body").append("div").transition(); 9 | }, 10 | "has a positive integer id": function(transition) { 11 | var id = transition.id; 12 | assert.isTrue(id > 0); 13 | assert.equal(~~id, id); 14 | }, 15 | "increases monotonically across transitions": function(transition) { 16 | var t0 = d3.select("body").append("div").transition(), 17 | t1 = d3.select("body").append("div").transition(); 18 | assert.isTrue(t1.id > t0.id); 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /vis/lib/d3/test/core/transition-test-text.js: -------------------------------------------------------------------------------- 1 | require("../env"); 2 | require("../../d3"); 3 | 4 | var assert = require("assert"); 5 | 6 | module.exports = { 7 | topic: function() { 8 | return d3.select("body").append("div").text("foo").transition().text("bar"); 9 | }, 10 | "sets the text tween": function(div) { 11 | assert.typeOf(div.tween("text"), "function"); 12 | }, 13 | "start": { 14 | topic: function(div) { 15 | var cb = this.callback, 16 | tween = div.tween("text"); 17 | div.tween("text", function() { 18 | var result = tween.apply(this, arguments); 19 | cb(null, {transition: div, tween: result}); 20 | return result; 21 | }); 22 | }, 23 | "sets the text content as a string": function(result) { 24 | assert.equal(result.transition[0][0].node.textContent, "bar"); 25 | }, 26 | "does not interpolate text": function(result) { 27 | assert.isTrue(!result.tween); 28 | } 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /vis/lib/d3/test/core/values-test.js: -------------------------------------------------------------------------------- 1 | require("../env"); 2 | require("../../d3"); 3 | 4 | var vows = require("vows"), 5 | assert = require("assert"); 6 | 7 | var suite = vows.describe("d3.values"); 8 | 9 | suite.addBatch({ 10 | "values": { 11 | topic: function() { 12 | return d3.values; 13 | }, 14 | "enumerates every value": function(values) { 15 | assert.deepEqual(values({a: 1, b: 2}), [1, 2]); 16 | }, 17 | "includes values defined on prototypes": function(values) { 18 | function abc() { 19 | this.a = 1; 20 | this.b = 2; 21 | } 22 | abc.prototype.c = 3; 23 | assert.deepEqual(values(new abc()), [1, 2, 3]); 24 | }, 25 | "includes null or undefined values": function(values) { 26 | var v = values({a: undefined, b: null, c: NaN}); 27 | assert.isUndefined(v[0]); 28 | assert.isNull(v[1]); 29 | assert.isNaN(v[2]); 30 | assert.equal(v.length, 3); 31 | } 32 | } 33 | }); 34 | 35 | suite.export(module); 36 | -------------------------------------------------------------------------------- /vis/lib/d3/test/core/version-test.js: -------------------------------------------------------------------------------- 1 | require("../env"); 2 | require("../../d3"); 3 | 4 | var vows = require("vows"), 5 | assert = require("assert"); 6 | 7 | var suite = vows.describe("d3.version"); 8 | 9 | suite.addBatch({ 10 | "semantic versioning": { 11 | topic: d3.version, 12 | "has the form major.minor.patch": function(version) { 13 | assert.match(version, /^[0-9]+\.[0-9]+\.[0-9]+$/); 14 | } 15 | } 16 | }); 17 | 18 | suite.export(module); 19 | -------------------------------------------------------------------------------- /vis/lib/d3/test/env-fragment.js: -------------------------------------------------------------------------------- 1 | var jsdom = require("jsdom"); 2 | 3 | document.createRange = function() { 4 | return { 5 | selectNode: function() {}, 6 | createContextualFragment: function(html) { return jsdom.jsdom(html); } 7 | }; 8 | }; 9 | -------------------------------------------------------------------------------- /vis/lib/d3/test/env.js: -------------------------------------------------------------------------------- 1 | document = require("jsdom").jsdom(""); 2 | window = document.createWindow(); 3 | navigator = window.navigator; 4 | CSSStyleDeclaration = window.CSSStyleDeclaration; 5 | 6 | require("../lib/sizzle/sizzle"); 7 | Sizzle = window.Sizzle; 8 | 9 | process.env.TZ = "America/Los_Angeles"; 10 | 11 | require("./env-assert"); 12 | require("./env-xhr"); 13 | require("./env-fragment"); 14 | -------------------------------------------------------------------------------- /vis/lib/d3/test/geo/path-test.js: -------------------------------------------------------------------------------- 1 | require("../env"); 2 | require("../../d3"); 3 | require("../../d3.geo"); 4 | 5 | var vows = require("vows"), 6 | assert = require("assert"); 7 | 8 | var suite = vows.describe("d3.geo.path"); 9 | 10 | suite.addBatch({ 11 | "path": { 12 | topic: d3.geo.path, 13 | "Polygon": function(path) { 14 | assert.equal(path({ 15 | type: "Feature", 16 | geometry: { 17 | type: "Polygon", 18 | coordinates: [[[-63.03, 18.02], [-63.14, 18.06], [-63.01, 18.07], [-63.03, 18.02]]] 19 | }, 20 | }), "M984.5652086349427,468.99159422596244L981.8396467935554,467.9114977057422L985.0785139575695,467.688661596079Z"); 21 | } 22 | } 23 | }); 24 | 25 | suite.export(module); 26 | -------------------------------------------------------------------------------- /vis/lib/d3/test/layout/pie-test.js: -------------------------------------------------------------------------------- 1 | require("../env"); 2 | require("../../d3"); 3 | require("../../d3.layout"); 4 | 5 | var vows = require("vows"), 6 | assert = require("assert"); 7 | 8 | var suite = vows.describe("d3.layout.pie"); 9 | 10 | suite.addBatch({ 11 | "pie": { 12 | topic: d3.layout.pie, 13 | "arcs are in same order as original data": function(pie) { 14 | assert.deepEqual(pie([5, 30, 15]).map(function(d) { return d.data; }), [ 15 | 5, 30, 15 16 | ]); 17 | assert.deepEqual(pie([ 18 | 84, 90, 48, 61, 58, 8, 6, 31, 45, 18 19 | ]).map(function(d) { return d.data; }), [ 20 | 84, 90, 48, 61, 58, 8, 6, 31, 45, 18 21 | ]); 22 | } 23 | } 24 | }); 25 | 26 | suite.export(module); 27 | -------------------------------------------------------------------------------- /vis/lib/globe/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2011 Google Data Arts Team 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | -------------------------------------------------------------------------------- /vis/lib/globe/globe/ce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/globe/globe/ce.png -------------------------------------------------------------------------------- /vis/lib/globe/globe/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/globe/globe/loading.gif -------------------------------------------------------------------------------- /vis/lib/globe/globe/third-party/Three/RequestAnimationFrame.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides requestAnimationFrame in a cross browser way. 3 | * http://paulirish.com/2011/requestanimationframe-for-smart-animating/ 4 | */ 5 | 6 | if ( !window.requestAnimationFrame ) { 7 | 8 | window.requestAnimationFrame = ( function() { 9 | 10 | return window.webkitRequestAnimationFrame || 11 | window.mozRequestAnimationFrame || 12 | window.oRequestAnimationFrame || 13 | window.msRequestAnimationFrame || 14 | function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) { 15 | 16 | window.setTimeout( callback, 1000 / 60 ); 17 | 18 | }; 19 | 20 | } )(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /vis/lib/globe/globe/world.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/globe/globe/world.jpg -------------------------------------------------------------------------------- /vis/lib/globe/webgl-globe.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/packetloop/packetpig/6e101090224df219123ff5f6ab4c37524637571f/vis/lib/globe/webgl-globe.zip -------------------------------------------------------------------------------- /vis/lib/packetloop/packetloop.js: -------------------------------------------------------------------------------- 1 | Packetloop = {} 2 | --------------------------------------------------------------------------------